Skip to content

Commit

Permalink
Decrease node group size only if the node pass resource check for sca…
Browse files Browse the repository at this point in the history
…le down candidate
  • Loading branch information
yaroslava-serdiuk committed Feb 16, 2023
1 parent 60a264b commit 2f6867d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file not shown.
2 changes: 1 addition & 1 deletion cluster-autoscaler/core/scaledown/unneeded/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ func (n *Nodes) unremovableReason(context *context.AutoscalingContext, v *node,
if reason := verifyMinSize(node.Name, nodeGroup, nodeGroupSize, as); reason != simulator.NoReason {
return reason
}
nodeGroupSize[nodeGroup.Id()]--

resourceDelta, err := n.limitsFinder.DeltaForNode(context, node, nodeGroup, resourcesWithLimits)
if err != nil {
Expand All @@ -209,6 +208,7 @@ func (n *Nodes) unremovableReason(context *context.AutoscalingContext, v *node,
return simulator.MinimalResourceLimitExceeded
}

nodeGroupSize[nodeGroup.Id()]--
return simulator.NoReason
}

Expand Down

0 comments on commit 2f6867d

Please sign in to comment.