Make lint happier

Without this, golint is complaining about a few cosmetic changes.
This solves it, and is necessary if we want to add a lint test
in CI.
This commit is contained in:
Jean-Philippe Evrard
2020-11-05 10:14:39 +01:00
parent ce6075c800
commit 7091debe23
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -151,10 +151,9 @@ func rebootRequired() bool {
if sentinelExists() {
log.Infof("Reboot required")
return true
} else {
log.Infof("Reboot not required")
return false
}
log.Infof("Reboot not required")
return false
}
func rebootBlocked(client *kubernetes.Clientset, nodeID string) bool {
@@ -334,7 +333,7 @@ func rebootAsRequired(nodeID string, window *timewindow.TimeWindow, TTL time.Dur
source := rand.NewSource(time.Now().UnixNano())
tick := delaytick.New(source, period)
for _ = range tick {
for range tick {
if window.Contains(time.Now()) && rebootRequired() && !rebootBlocked(client, nodeID) {
node, err := client.CoreV1().Nodes().Get(context.TODO(), nodeID, metav1.GetOptions{})
if err != nil {
+2 -2
View File
@@ -12,7 +12,7 @@ import (
"github.com/prometheus/common/model"
)
// Returns a list of names of active (e.g. pending or firing) alerts, filtered
// PrometheusActiveAlerts returns a list of names of active (e.g. pending or firing) alerts, filtered
// by the supplied regexp.
func PrometheusActiveAlerts(prometheusURL string, filter *regexp.Regexp) ([]string, error) {
client, err := api.NewClient(api.Config{Address: prometheusURL})
@@ -39,7 +39,7 @@ func PrometheusActiveAlerts(prometheusURL string, filter *regexp.Regexp) ([]stri
}
var activeAlerts []string
for activeAlert, _ := range activeAlertSet {
for activeAlert := range activeAlertSet {
activeAlerts = append(activeAlerts, activeAlert)
}
sort.Sort(sort.StringSlice(activeAlerts))