Skip to content

Commit 3f617a1

Browse files
committed
Caches should be updated after async PUT succeeds
1 parent 1fb87b1 commit 3f617a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cluster-autoscaler/cloudprovider/azure/azure_scale_set.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
275275
return fmt.Errorf("VMSS %q is still under updating", scaleSet.Name)
276276
}
277277

278-
// Proactively set the VMSS size so autoscaler makes better decisions.
279-
scaleSet.curSize = size
280-
scaleSet.lastSizeRefresh = time.Now()
281-
282278
// Update the new capacity to cache.
283279
vmssSizeMutex.Lock()
284280
vmssInfo.Sku.Capacity = &size
@@ -300,6 +296,10 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
300296
return rerr.Error()
301297
}
302298

299+
// Proactively set the VMSS size so autoscaler makes better decisions.
300+
scaleSet.curSize = size
301+
scaleSet.lastSizeRefresh = time.Now()
302+
303303
klog.V(3).Infof("create a goroutine to wait for the result of the virtualMachineScaleSetsClient.CreateOrUpdate request")
304304
go scaleSet.updateVMSSCapacity(future)
305305

0 commit comments

Comments
 (0)