Skip to content

Commit

Permalink
Merge pull request #1771 from frobware/fix-scale-up-calculation
Browse files Browse the repository at this point in the history
UPSTREAM: <carry>: fix max cluster size calculation on scale up
  • Loading branch information
k8s-ci-robot authored Mar 8, 2019
2 parents 6a6245b + 5ae76ea commit 387818a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cluster-autoscaler/core/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func ScaleUp(context *context.AutoscalingContext, processors *ca_processors.Auto

newNodes := bestOption.NodeCount

if context.MaxNodesTotal > 0 && len(nodes)+newNodes > context.MaxNodesTotal {
if context.MaxNodesTotal > 0 && len(nodes)+newNodes+len(upcomingNodes) > context.MaxNodesTotal {
klog.V(1).Infof("Capping size to max cluster total size (%d)", context.MaxNodesTotal)
newNodes = context.MaxNodesTotal - len(nodes) - len(upcomingNodes)
if newNodes < 1 {
Expand Down

0 comments on commit 387818a

Please sign in to comment.