Skip to content

Commit

Permalink
Merge pull request #3236 from marwanad/save-invalidation-calls-during…
Browse files Browse the repository at this point in the history
…-scale-down

no need to invalidate scale-set caches on scale-down
  • Loading branch information
k8s-ci-robot authored Jun 24, 2020
2 parents 55e05c8 + 88ad78f commit 99b571f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cluster-autoscaler/cloudprovider/azure/azure_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ func (scaleSet *ScaleSet) waitForDeleteInstances(future *azure.Future, requiredI

defer func() {
if err != nil {
klog.Errorf("Failed to delete instances %v. Invalidating the cache to get the real scale set size", requiredIds.InstanceIds)
scaleSet.invalidateStatusCacheWithLock()
klog.Errorf("Failed to delete instances %v", requiredIds.InstanceIds)
}
}()

Expand All @@ -244,7 +243,6 @@ func (scaleSet *ScaleSet) waitForDeleteInstances(future *azure.Future, requiredI
isSuccess, err := isSuccessHTTPResponse(httpResponse, err)
if isSuccess {
klog.V(3).Infof("virtualMachineScaleSetsClient.WaitForAsyncOperationResult - DeleteInstances(%v) success", requiredIds.InstanceIds)
scaleSet.invalidateInstanceCache()
return
}
klog.Errorf("virtualMachineScaleSetsClient.WaitForAsyncOperationResult - DeleteInstances for instances %v failed with error: %v", requiredIds.InstanceIds, err)
Expand All @@ -270,7 +268,6 @@ func (scaleSet *ScaleSet) updateVMSSCapacity(future *azure.Future) {
if isSuccess {
klog.V(3).Infof("virtualMachineScaleSetsClient.WaitForAsyncOperationResult(%s) success", scaleSet.Name)
scaleSet.invalidateInstanceCache()

return
}

Expand Down

0 comments on commit 99b571f

Please sign in to comment.