Skip to content

Commit

Permalink
Merge pull request #5317 from grosser/grosser/ref2
Browse files Browse the repository at this point in the history
cluster-autoscaler: refactor BalanceScaleUpBetweenGroups
  • Loading branch information
k8s-ci-robot authored Dec 19, 2022
2 parents a46a095 + 62f29d2 commit d9ffb8f
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,16 @@ func (b *BalancingNodeGroupSetProcessor) BalanceScaleUpBetweenGroups(context *co
// group already maxed, ignore it
continue
}
info := ScaleUpInfo{
if maxSize > currentSize {
// we still have capacity to expand
totalCapacity += (maxSize - currentSize)
}
scaleUpInfos = append(scaleUpInfos, ScaleUpInfo{
Group: ng,
CurrentSize: currentSize,
NewSize: currentSize,
MaxSize: maxSize}
scaleUpInfos = append(scaleUpInfos, info)
if maxSize-currentSize > 0 {
totalCapacity += maxSize - currentSize
}
MaxSize: maxSize,
})
}
if totalCapacity < newNodes {
klog.V(2).Infof("Requested scale-up (%v) exceeds node group set capacity, capping to %v", newNodes, totalCapacity)
Expand Down

0 comments on commit d9ffb8f

Please sign in to comment.