Skip to content

Commit c182a59

Browse files
authored
Merge pull request kubernetes#94306 from knight42/fix/azure-error-from-getVMSS
fix(azure): check error returned by scaleSet.getVMSS
2 parents 220c3f4 + 27bbe9a commit c182a59

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,17 +1406,16 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromVMSS(service *v1.Service, backen
14061406

14071407
for vmssName := range vmssNamesMap {
14081408
vmss, err := ss.getVMSS(vmssName, azcache.CacheReadTypeDefault)
1409+
if err != nil {
1410+
return err
1411+
}
14091412

14101413
// When vmss is being deleted, CreateOrUpdate API would report "the vmss is being deleted" error.
14111414
// Since it is being deleted, we shouldn't send more CreateOrUpdate requests for it.
14121415
if vmss.ProvisioningState != nil && strings.EqualFold(*vmss.ProvisioningState, virtualMachineScaleSetsDeallocating) {
14131416
klog.V(3).Infof("ensureVMSSInPool: found vmss %s being deleted, skipping", vmssName)
14141417
continue
14151418
}
1416-
1417-
if err != nil {
1418-
return err
1419-
}
14201419
if vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations == nil {
14211420
klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vmss %s", vmssName)
14221421
continue

0 commit comments

Comments
 (0)