From 1898b67e1f34c5dcff91c5128f5e8dfd6a3d1860 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 1 Jun 2017 16:20:52 +0000 Subject: [PATCH] Use 127.0.0.1 instead of localhost in case that name resolves to something else --- extras/fixprobe/main.go | 2 +- probe/kubernetes/reporter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/fixprobe/main.go b/extras/fixprobe/main.go index cb1ceaffb..5b99925cb 100644 --- a/extras/fixprobe/main.go +++ b/extras/fixprobe/main.go @@ -19,7 +19,7 @@ import ( func main() { var ( - publish = flag.String("publish", fmt.Sprintf("localhost:%d", xfer.AppPort), "publish target") + publish = flag.String("publish", fmt.Sprintf("127.0.0.1:%d", xfer.AppPort), "publish target") publishInterval = flag.Duration("publish.interval", 1*time.Second, "publish (output) interval") publishToken = flag.String("publish.token", "fixprobe", "publish token, for if we are talking to the service") publishID = flag.String("publish.id", "fixprobe", "publisher ID used to identify publishers") diff --git a/probe/kubernetes/reporter.go b/probe/kubernetes/reporter.go index ad79f728b..4af07f6a4 100644 --- a/probe/kubernetes/reporter.go +++ b/probe/kubernetes/reporter.go @@ -429,7 +429,7 @@ func (r *Reporter) podTopology(services []Service, replicaSets []ReplicaSet, dae // 1. reconstructing the NodeName requires cloud provider credentials // 2. inferring the NodeName out of the hostname or system uuid is unreliable // (uuids and hostnames can be duplicated across the cluster). - localPodUIDs, errUIDs := GetLocalPodUIDs(fmt.Sprintf("localhost:%d", r.kubeletPort)) + localPodUIDs, errUIDs := GetLocalPodUIDs(fmt.Sprintf("127.0.0.1:%d", r.kubeletPort)) if errUIDs != nil { log.Warnf("Cannot obtain local pods, reporting all (which may impact performance): %v", errUIDs) }