Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract criteria for removing unneded nodes to a separate package #5147

Merged
merged 2 commits into from
Oct 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Drop unused maps
x13n committed Sep 26, 2022
commit 07b531c8ba26e7298c97c5d2e2334a60d257e786
4 changes: 0 additions & 4 deletions cluster-autoscaler/core/scaledown/legacy/legacy.go
Original file line number Diff line number Diff line change
@@ -323,8 +323,6 @@ func (sd *ScaleDown) NodesToDelete(currentTime time.Time, pdbs []*policyv1.PodDi
}

candidateNames := make([]string, 0)
readinessMap := make(map[string]bool)
candidateNodeGroups := make(map[string]cloudprovider.NodeGroup)

resourceLimiter, errCP := sd.context.CloudProvider.GetResourceLimiter()
if errCP != nil {
@@ -354,7 +352,6 @@ func (sd *ScaleDown) NodesToDelete(currentTime time.Time, pdbs []*policyv1.PodDi
}

ready, _, _ := kube_util.GetReadinessState(node)
readinessMap[node.Name] = ready

nodeGroup, err := sd.context.CloudProvider.NodeGroupForNode(node)
if err != nil {
@@ -431,7 +428,6 @@ func (sd *ScaleDown) NodesToDelete(currentTime time.Time, pdbs []*policyv1.PodDi
}

candidateNames = append(candidateNames, node.Name)
candidateNodeGroups[node.Name] = nodeGroup
}

if len(candidateNames) == 0 {