Skip to content

Commit ce81a6a

Browse files
authored
Merge pull request #8289 from pmendelski/exclude-injected-node-groups-from-balancing
Filter out non-existing node-groups before scale-up balancing
2 parents ffe6219 + 792fba7 commit ce81a6a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cluster-autoscaler/core/scaleup/orchestrator/orchestrator.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,16 @@ func (o *ScaleUpOrchestrator) balanceScaleUps(
714714
schedulablePodGroups map[string][]estimator.PodEquivalenceGroup,
715715
) ([]nodegroupset.ScaleUpInfo, errors.AutoscalerError) {
716716
// Recompute similar node groups in case they need to be updated
717-
similarNodeGroups := o.ComputeSimilarNodeGroups(nodeGroup, nodeInfos, schedulablePodGroups, now)
717+
nodeGroups := o.ComputeSimilarNodeGroups(nodeGroup, nodeInfos, schedulablePodGroups, now)
718+
719+
// Similar node groups may return injected node groups as they are used for simulations
720+
var similarNodeGroups []cloudprovider.NodeGroup
721+
for _, ng := range nodeGroups {
722+
if ng.Exist() || o.scaleUpExecutor.asyncNodeGroupStateChecker.IsUpcoming(ng) {
723+
similarNodeGroups = append(similarNodeGroups, ng)
724+
}
725+
}
726+
718727
if similarNodeGroups != nil {
719728
// if similar node groups are found, log about them
720729
similarNodeGroupIds := make([]string, 0)

0 commit comments

Comments
 (0)