mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
kubeadm: break out check for err and hostname
This commit is contained in:
parent
2c0b3da430
commit
8e06ea9bda
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user