Skip to content

Commit

Permalink
Merge pull request kubernetes#3024 from feiskyer/fixes
Browse files Browse the repository at this point in the history
Caches should be updated after async PUT succeeds
  • Loading branch information
k8s-ci-robot authored Apr 6, 2020
2 parents 1fb87b1 + 3f617a1 commit e816740
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cluster-autoscaler/cloudprovider/azure/azure_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,6 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
return fmt.Errorf("VMSS %q is still under updating", scaleSet.Name)
}

// Proactively set the VMSS size so autoscaler makes better decisions.
scaleSet.curSize = size
scaleSet.lastSizeRefresh = time.Now()

// Update the new capacity to cache.
vmssSizeMutex.Lock()
vmssInfo.Sku.Capacity = &size
Expand All @@ -300,6 +296,10 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
return rerr.Error()
}

// Proactively set the VMSS size so autoscaler makes better decisions.
scaleSet.curSize = size
scaleSet.lastSizeRefresh = time.Now()

klog.V(3).Infof("create a goroutine to wait for the result of the virtualMachineScaleSetsClient.CreateOrUpdate request")
go scaleSet.updateVMSSCapacity(future)

Expand Down

0 comments on commit e816740

Please sign in to comment.