mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +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) {
|
for _, msg := range validation.ValidateNodeName(hostname, false) {
|
||||||
errors = append(errors, fmt.Errorf("hostname \"%s\" %s", hostname, msg))
|
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
|
return nil, errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user