From 2c0b3da430bd3880a2b8dc2938716f65080e830a Mon Sep 17 00:00:00 2001 From: Derek McQuay Date: Tue, 31 Jan 2017 15:42:46 -0800 Subject: [PATCH 1/2] kubeadm: preflight check for incorrect FQDN? --- cmd/kubeadm/app/preflight/checks.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 2d3b4d5107e..2cbc683176b 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -243,6 +243,10 @@ func (hc HostnameCheck) Check() (warnings, errors []error) { 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 || err != nil { + errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, err)) + } return nil, errors } From 8e06ea9bdaff2303aa6f3aedce24b99559669463 Mon Sep 17 00:00:00 2001 From: Derek McQuay Date: Wed, 1 Feb 2017 11:51:16 -0800 Subject: [PATCH 2/2] 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