mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 16:21:13 +00:00
Catch the case where we cannot find any nodes.
It's possible to fall through the loops above with node still nil. This catches this and reports an error. Found this working on #27819.
This commit is contained in:
parent
4e2433cfab
commit
d6ab379275
@ -659,6 +659,10 @@ func (kd *KubeDNS) getClusterZone() (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if node == nil {
|
||||
return "", fmt.Errorf("Could not find any nodes")
|
||||
}
|
||||
|
||||
zone, ok := node.Annotations[unversioned.LabelZoneFailureDomain]
|
||||
if !ok || zone == "" {
|
||||
return "", fmt.Errorf("unknown cluster zone")
|
||||
|
Loading…
Reference in New Issue
Block a user