Don't use the first token uname -n as the hostname

This change partially reverts the change made in #7910, which takes only the
first token of `uname -n` as the hostname.
This commit is contained in:
Yu-Ju Hong
2015-05-08 10:03:43 -07:00
parent 0d16f43475
commit 170f426fb6

View File

@@ -30,10 +30,7 @@ func GetHostname(hostnameOverride string) string {
if err != nil {
glog.Fatalf("Couldn't determine hostname: %v", err)
}
chunks := strings.Split(string(nodename), ".")
// nodename could be a fully-qualified domain name or not. Take the first
// word of nodename as the hostname for consistency.
hostname = chunks[0]
hostname = string(nodename)
}
return strings.ToLower(strings.TrimSpace(hostname))
}