From 829c47f94da8ad85da958a2a1c2ae0964742654a Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Thu, 9 Feb 2017 23:11:26 +0000 Subject: [PATCH] kubeadm: preflight should only warn about unresolvable hostnames This is quite often the case on AWS, and we really don't care if the hostname is resolvable or not. It's not an easy problem to ask user to fix, and there is no functional penalty at the Kubernetes level, also it's possible that users fixes their host resolution eventually, we don't have to make them do so. --- cmd/kubeadm/app/preflight/checks.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index cff64a87065..0f0deef9d5d 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -239,18 +239,19 @@ type HostnameCheck struct{} func (hc HostnameCheck) Check() (warnings, errors []error) { errors = []error{} + warnings = []error{} hostname := node.GetHostname("") for _, msg := range validation.ValidateNodeName(hostname, false) { errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, msg)) } addr, err := net.LookupHost(hostname) if addr == nil { - errors = append(errors, fmt.Errorf("hostname \"%s\" could not be reached", hostname)) + warnings = append(warnings, fmt.Errorf("hostname \"%s\" could not be reached", hostname)) } if err != nil { - errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, err)) + warnings = append(warnings, fmt.Errorf("hostname \"%s\" %s", hostname, err)) } - return nil, errors + return warnings, errors } // HTTPProxyCheck checks if https connection to specific host is going