Recalculate similar node groups for the best scale-up option

This commit is contained in:
Bartłomiej Wróblewski 2023-05-23 17:18:16 +00:00
parent 982c82176c
commit 65c0175864
1 changed files with 3 additions and 3 deletions

View File

@ -220,11 +220,11 @@ func (o *ScaleUpOrchestrator) ScaleUp(
// TODO(lukaszos) when pursuing scalability update this call with one which takes list of changed node groups so we do not
// do extra API calls. (the call at the bottom of ScaleUp() could be also changed then)
o.clusterStateRegistry.Recalculate()
// Recompute similar node groups
bestOption.SimilarNodeGroups = o.ComputeSimilarNodeGroups(createNodeGroupResult.MainCreatedNodeGroup, nodeInfos, schedulablePods, now)
}
// Recompute similar node groups in case they need to be updated
bestOption.SimilarNodeGroups = o.ComputeSimilarNodeGroups(bestOption.NodeGroup, nodeInfos, schedulablePods, now)
nodeInfo, found := nodeInfos[bestOption.NodeGroup.Id()]
if !found {
// This should never happen, as we already should have retrieved nodeInfo for any considered nodegroup.