kubeadm: break out check for err and hostname

This commit is contained in:
Derek McQuay 2017-02-01 11:51:16 -08:00
parent 2c0b3da430
commit 8e06ea9bda
No known key found for this signature in database
GPG Key ID: 92A7BC0C86B0B91A

View File

@ -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