Skip to content

Commit

Permalink
Fix typo in ProvisioningRequestScaleUpMode
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslava-serdiuk committed Nov 5, 2024
1 parent 7ea1022 commit f6a4671
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cluster-autoscaler/context/autoscaling_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type AutoscalingContext struct {
// ClusterStateRegistry tracks the health of the node groups and pending scale-ups and scale-downs
ClusterStateRegistry *clusterstate.ClusterStateRegistry
//ProvisionRequstScaleUpMode indicates whether ClusterAutoscaler tries to accommodate ProvisioningRequest in current scale up iteration.
ProvisioningRequstScaleUpMode bool
ProvisioningRequestScaleUpMode bool
}

// AutoscalingKubeClients contains all Kubernetes API clients,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ func (o *WrapperOrchestrator) ScaleUp(
allOrNothing bool,
) (*status.ScaleUpStatus, errors.AutoscalerError) {
defer func() {
o.autoscalingContext.ProvisioningRequstScaleUpMode = !o.autoscalingContext.ProvisioningRequstScaleUpMode
o.autoscalingContext.ProvisioningRequestScaleUpMode = !o.autoscalingContext.ProvisioningRequestScaleUpMode
}()

provReqPods, regularPods := splitOut(unschedulablePods)
if len(provReqPods) == 0 {
o.autoscalingContext.ProvisioningRequstScaleUpMode = false
o.autoscalingContext.ProvisioningRequestScaleUpMode = false
} else if len(regularPods) == 0 {
o.autoscalingContext.ProvisioningRequstScaleUpMode = true
o.autoscalingContext.ProvisioningRequestScaleUpMode = true
}

if o.autoscalingContext.ProvisioningRequstScaleUpMode {
if o.autoscalingContext.ProvisioningRequestScaleUpMode {
return o.provReqOrchestrator.ScaleUp(provReqPods, nodes, daemonSets, nodeInfos, allOrNothing)
}
return o.podsOrchestrator.ScaleUp(regularPods, nodes, daemonSets, nodeInfos, allOrNothing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (

func TestWrapperScaleUp(t *testing.T) {
o := WrapperOrchestrator{
autoscalingContext: &context.AutoscalingContext{ProvisioningRequstScaleUpMode: true},
autoscalingContext: &context.AutoscalingContext{ProvisioningRequestScaleUpMode: true},
provReqOrchestrator: &fakeScaleUp{provisioningRequestErrorMsg},
podsOrchestrator: &fakeScaleUp{regularPodsErrorMsg},
}
Expand Down

0 comments on commit f6a4671

Please sign in to comment.