Skip to content

Commit d3df233

Browse files
authored
Merge pull request kubernetes#89337 from feiskyer/fix-89336
Fix the VMSS name and resource group name when updating VMSS for LoadBalancer backendPools
2 parents a9d915c + 0cb5f3b commit d3df233

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ func getVmssAndResourceGroupNameByVMProviderID(providerID string) (string, strin
917917
}
918918

919919
func (ss *scaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, backendPoolID string, vmSetName string) error {
920+
klog.V(2).Infof("ensureVMSSInPool: ensuring VMSS with backendPoolID %s", backendPoolID)
920921
vmssNamesMap := make(map[string]bool)
921922

922923
// the standard load balancer supports multiple vmss in its backend while the basic sku doesn't
@@ -926,7 +927,7 @@ func (ss *scaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back
926927
continue
927928
}
928929
// in this scenario the vmSetName is an empty string and the name of vmss should be obtained from the provider IDs of nodes
929-
vmssName, resourceGroupName, err := getVmssAndResourceGroupNameByVMProviderID(node.Spec.ProviderID)
930+
resourceGroupName, vmssName, err := getVmssAndResourceGroupNameByVMProviderID(node.Spec.ProviderID)
930931
if err != nil {
931932
klog.V(4).Infof("ensureVMSSInPool: found VMAS node %s, will skip checking and continue", node.Name)
932933
continue
@@ -940,6 +941,7 @@ func (ss *scaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back
940941
vmssNamesMap[vmSetName] = true
941942
}
942943

944+
klog.V(2).Infof("ensureVMSSInPool begins to update VMSS %v with backendPoolID %s", vmssNamesMap, backendPoolID)
943945
for vmssName := range vmssNamesMap {
944946
vmss, err := ss.getVMSS(vmssName, azcache.CacheReadTypeDefault)
945947
if err != nil {

0 commit comments

Comments
 (0)