1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 19:49:46 +00:00

prometheus: Fix various go1.10 errors

This commit is contained in:
Frederic Branczyk 2018-02-28 14:53:49 +01:00
parent c740809f23
commit ebc832a115
No known key found for this signature in database
GPG key ID: 7741A52782A90069
3 changed files with 8 additions and 7 deletions
cmd/po-docgen
contrib/prometheus-config-reloader
pkg/prometheus

View file

@ -38,8 +38,9 @@ Due to the use of CustomResourceDefinitions Kubernetes >= v1.7.0 is required.
## Prometheus
The versions of Prometheus compatible to be run with the Prometheus Operator are:
`)
The versions of Prometheus compatible to be run with the Prometheus Operator are:`)
fmt.Println("")
for _, v := range prometheus.CompatibilityMatrix {
fmt.Printf("* %s\n", v)
}

View file

@ -195,7 +195,7 @@ func (w *volumeWatcher) ReloadPrometheus() error {
}
resp.Body.Close()
if resp.StatusCode != 200 {
return fmt.Errorf("Received response code %s, expected 200", resp.StatusCode)
return fmt.Errorf("Received response code %d, expected 200", resp.StatusCode)
}
return nil
}

View file

@ -269,10 +269,10 @@ func TestMemoryRequestNotAdjustedWhenLimitLarger2Gi(t *testing.T) {
resourceLimit := sset.Spec.Template.Spec.Containers[0].Resources.Limits[v1.ResourceMemory]
limitString := resourceLimit.String()
if requestString != "2Gi" {
t.Fatalf("Resource request is expected to be 1Gi, instead found %s", resourceRequest)
t.Fatalf("Resource request is expected to be 1Gi, instead found %s", requestString)
}
if limitString != "3Gi" {
t.Fatalf("Resource limit is expected to be 1Gi, instead found %s", resourceLimit)
t.Fatalf("Resource limit is expected to be 1Gi, instead found %s", limitString)
}
}
@ -295,10 +295,10 @@ func TestMemoryRequestAdjustedWhenOnlyLimitGiven(t *testing.T) {
resourceLimit := sset.Spec.Template.Spec.Containers[0].Resources.Limits[v1.ResourceMemory]
limitString := resourceLimit.String()
if requestString != "1Gi" {
t.Fatalf("Resource request is expected to be 1Gi, instead found %s", resourceRequest)
t.Fatalf("Resource request is expected to be 1Gi, instead found %s", requestString)
}
if limitString != "1Gi" {
t.Fatalf("Resource limit is expected to be 1Gi, instead found %s", resourceLimit)
t.Fatalf("Resource limit is expected to be 1Gi, instead found %s", limitString)
}
}