mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
kubeadm: preflight check for incorrect FQDN?
This commit is contained in:
parent
1157b5a116
commit
2c0b3da430
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user