From 8e06ea9bdaff2303aa6f3aedce24b99559669463 Mon Sep 17 00:00:00 2001 From: Derek McQuay Date: Wed, 1 Feb 2017 11:51:16 -0800 Subject: [PATCH] kubeadm: break out check for err and hostname --- cmd/kubeadm/app/preflight/checks.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 2cbc683176b..544720a13f0 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -244,7 +244,10 @@ func (hc HostnameCheck) Check() (warnings, errors []error) { errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, msg)) } addr, err := net.LookupHost(hostname) - if addr == nil || err != nil { + if addr == nil { + errors = append(errors, fmt.Errorf("hostname \"%s\" could not be reached", hostname)) + } + if err != nil { errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, err)) } return nil, errors