kubeadm: preflight check for incorrect FQDN?

This commit is contained in:
Derek McQuay 2017-01-31 15:42:46 -08:00
parent 1157b5a116
commit 2c0b3da430
No known key found for this signature in database
GPG Key ID: 92A7BC0C86B0B91A

View File

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