Skip to content

Commit

Permalink
Use 127.0.0.1 instead of localhost in case that name resolves to some…
Browse files Browse the repository at this point in the history
…thing else
  • Loading branch information
bboreham committed Jun 1, 2017
1 parent 06bb515 commit 9c36d83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extras/fixprobe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion probe/kubernetes/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions tools/socks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const (
pacfile = `
function FindProxyForURL(url, host) {
if(shExpMatch(host, "{{.HostMatch}}")) {
return "SOCKS5 localhost:8000";
return "SOCKS5 127.0.0.1:8000";
}
{{range $key, $value := .Aliases}}
if (host == "{{$key}}") {
return "SOCKS5 localhost:8000";
return "SOCKS5 127.0.0.1:8000";
}
{{end}}
return "DIRECT";
Expand Down

0 comments on commit 9c36d83

Please sign in to comment.