Skip to content

Commit

Permalink
Added scaleDownActuationStatus.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham82 committed Feb 5, 2024
1 parent f6a38be commit 7897c02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
return caerrors.ToAutoscalerError(caerrors.ApiCallError, err)
}

// Snapshot scale-down actuation status before cache refresh.
scaleDownActuationStatus := a.scaleDownActuator.CheckStatus()
// Call CloudProvider.Refresh before any other calls to cloud provider.
refreshStart := time.Now()
err = a.AutoscalingContext.CloudProvider.Refresh()
Expand Down Expand Up @@ -601,8 +603,7 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) caerrors.AutoscalerErr
}
}

actuationStatus := a.scaleDownActuator.CheckStatus()
typedErr := a.scaleDownPlanner.UpdateClusterState(podDestinations, scaleDownCandidates, actuationStatus, currentTime)
typedErr := a.scaleDownPlanner.UpdateClusterState(podDestinations, scaleDownCandidates, scaleDownActuationStatus, currentTime)
// Update clusterStateRegistry and metrics regardless of whether ScaleDown was successful or not.
unneededNodes := a.scaleDownPlanner.UnneededNodes()
a.processors.ScaleDownCandidatesNotifier.Update(unneededNodes, currentTime)
Expand Down

0 comments on commit 7897c02

Please sign in to comment.