Skip to content

Commit 79e0e71

Browse files
committed
make fmt
1 parent 49336fa commit 79e0e71

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

plugins/inputs/prometheus/kubernetes.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (p *Prometheus) watch(ctx context.Context, client *k8s.Client) error {
152152

153153
func (p *Prometheus) cAdvisor(ctx context.Context, client *k8s.Client) error {
154154
p.Log.Infof("Using monitor pods version 2 to get pod list using cAdvisor.")
155-
155+
156156
nodeIP := os.Getenv("NODE_IP")
157157
if nodeIP == "" {
158158
return errors.New("The environment variable NODE_IP is not set. Cannot get pod list for monitor_kubernetes_pods using version 2.")
@@ -204,7 +204,7 @@ func (p *Prometheus) cAdvisor(ctx context.Context, client *k8s.Client) error {
204204
}
205205

206206
func updateCadvisorPodList(ctx context.Context, p *Prometheus, client *k8s.Client, req *http.Request,
207-
labelSelector labels.Selector, fieldSelector fields.Selector) error {
207+
labelSelector labels.Selector, fieldSelector fields.Selector) error {
208208

209209
resp, err := client.Client.Do(req)
210210
if err != nil {
@@ -232,7 +232,7 @@ func updateCadvisorPodList(ctx context.Context, p *Prometheus, client *k8s.Clien
232232
podHasMatchingNamespace(pod, p) &&
233233
podHasMatchingLabelSelector(pod, labelSelector) &&
234234
podHasMatchingFieldSelector(pod, fieldSelector) {
235-
registerPod(pod, p)
235+
registerPod(pod, p)
236236
}
237237

238238
}
@@ -243,14 +243,14 @@ func updateCadvisorPodList(ctx context.Context, p *Prometheus, client *k8s.Clien
243243
}
244244

245245
func fieldSelectorIsSupported(fieldSelector fields.Selector) bool {
246-
supportedFieldsToSelect := map[string]bool {
247-
"spec.nodeName" : true,
248-
"spec.restartPolicy" : true,
249-
"spec.schedulerName" : true,
250-
"spec.serviceAccountName" : true,
251-
"status.phase" : true,
252-
"status.podIP" : true,
253-
"status.nominatedNodeName" : true,
246+
supportedFieldsToSelect := map[string]bool{
247+
"spec.nodeName": true,
248+
"spec.restartPolicy": true,
249+
"spec.schedulerName": true,
250+
"spec.serviceAccountName": true,
251+
"status.phase": true,
252+
"status.podIP": true,
253+
"status.nominatedNodeName": true,
254254
}
255255

256256
for _, requirement := range fieldSelector.Requirements() {
@@ -289,7 +289,7 @@ func podHasMatchingFieldSelector(pod *corev1.Pod, fieldSelector fields.Selector)
289289

290290
// Spec and Status shouldn't be nil.
291291
// Error handling just in case something goes wrong but won't crash telegraf
292-
if (podSpec == nil || podStatus == nil) {
292+
if podSpec == nil || podStatus == nil {
293293
return false
294294
}
295295

plugins/inputs/prometheus/kubernetes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
v1 "github.com/ericchiang/k8s/apis/core/v1"
1111
metav1 "github.com/ericchiang/k8s/apis/meta/v1"
12-
12+
1313
"k8s.io/apimachinery/pkg/fields"
1414
"k8s.io/apimachinery/pkg/labels"
1515
)

0 commit comments

Comments
 (0)