Skip to content

Commit 9790262

Browse files
authored
Merge pull request kubernetes#84138 from nilo19/qi-fix-missing-zone-master
Return an error when zone info is not found.
2 parents c634276 + 19c09ff commit 9790262

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ func (ss *scaleSet) GetZoneByNodeName(name string) (cloudprovider.Zone, error) {
315315
} else if vm.InstanceView != nil && vm.InstanceView.PlatformFaultDomain != nil {
316316
// Availability zone is not used for the node, falling back to fault domain.
317317
failureDomain = strconv.Itoa(int(*vm.InstanceView.PlatformFaultDomain))
318+
} else {
319+
err = fmt.Errorf("failed to get zone info")
320+
klog.Errorf("GetZoneByNodeName: got unexpected error %v", err)
321+
ss.deleteCacheForNode(name)
322+
return cloudprovider.Zone{}, err
318323
}
319324

320325
return cloudprovider.Zone{

0 commit comments

Comments
 (0)