Skip to content

Commit ce3644c

Browse files
committed
Fix VMSS cache content
Using reference to a loop iterator variable is common mistake because it takes different values in each loop iteration.
1 parent a35f54e commit ce3644c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ func (ss *scaleSet) newVMSSCache() (*azcache.TimedCache, error) {
7373
return nil, rerr.Error()
7474
}
7575

76-
for _, scaleSet := range allScaleSets {
76+
for i := range allScaleSets {
77+
scaleSet := allScaleSets[i]
7778
if scaleSet.Name == nil || *scaleSet.Name == "" {
7879
klog.Warning("failed to get the name of VMSS")
7980
continue

0 commit comments

Comments
 (0)