Merge pull request #5317 from grosser/grosser/ref2
cluster-autoscaler: refactor BalanceScaleUpBetweenGroups
This commit is contained in:
commit
d9ffb8f5ce
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue