Fix VMSS cache content

Using reference to a loop iterator variable is common mistake because it
takes different values in each loop iteration.
This commit is contained in:
Dayang Shen 2020-03-10 19:11:42 +08:00
parent a35f54e3e8
commit ce3644ca59

View File

@ -73,7 +73,8 @@ func (ss *scaleSet) newVMSSCache() (*azcache.TimedCache, error) {
return nil, rerr.Error()
}
for _, scaleSet := range allScaleSets {
for i := range allScaleSets {
scaleSet := allScaleSets[i]
if scaleSet.Name == nil || *scaleSet.Name == "" {
klog.Warning("failed to get the name of VMSS")
continue