From b430513abf48ca14b343da0b5701ffb91c29cbd0 Mon Sep 17 00:00:00 2001 From: Adam Liddell Date: Tue, 5 Mar 2019 18:28:26 +0000 Subject: [PATCH] Enforce lower case hostname for node, references #160 --- pkg/agent/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index bd30229cbf0c..cee04aa8ed4e 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -10,6 +10,7 @@ import ( "os" "os/exec" "path/filepath" + "strings" "time" "github.com/pkg/errors" @@ -90,6 +91,10 @@ func getHostnameAndIP(info cmds.Agent) (string, string, error) { name = hostname } + // Use lower case hostname to comply with kubernetes constraint: + // https://github.com/kubernetes/kubernetes/issues/71140 + name = strings.ToLower(name) + return name, ip, nil }