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:
@@ -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")
|
||||
|
Reference in New Issue
Block a user