1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

NewPodEvictor: drop nodes parameter

This commit is contained in:
Jan Chaloupka
2024-06-22 15:02:07 +02:00
parent cdbd101eae
commit 0901cb18bf
19 changed files with 65 additions and 42 deletions

View File

@@ -196,7 +196,6 @@ func runPodLifetimePlugin(
false,
nil,
maxPodsToEvictPerNamespace,
nodes,
false,
&events.FakeRecorder{},
)
@@ -285,7 +284,7 @@ func TestLowNodeUtilization(t *testing.T) {
t.Errorf("Error listing node with %v", err)
}
nodes, workerNodes := splitNodesAndWorkerNodes(nodeList.Items)
_, workerNodes := splitNodesAndWorkerNodes(nodeList.Items)
t.Log("Creating testing namespace")
testNamespace := &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "e2e-" + strings.ToLower(t.Name())}}
@@ -374,7 +373,7 @@ func TestLowNodeUtilization(t *testing.T) {
waitForRCPodsRunning(ctx, t, clientSet, rc)
// Run LowNodeUtilization plugin
podEvictor := initPodEvictorOrFail(t, clientSet, getPodsAssignedToNode, nodes)
podEvictor := initPodEvictorOrFail(t, clientSet, getPodsAssignedToNode)
defaultevictorArgs := &defaultevictor.DefaultEvictorArgs{
EvictLocalStoragePods: true,
@@ -1570,7 +1569,7 @@ func splitNodesAndWorkerNodes(nodes []v1.Node) ([]*v1.Node, []*v1.Node) {
return allNodes, workerNodes
}
func initPodEvictorOrFail(t *testing.T, clientSet clientset.Interface, getPodsAssignedToNode podutil.GetPodsAssignedToNodeFunc, nodes []*v1.Node) *evictions.PodEvictor {
func initPodEvictorOrFail(t *testing.T, clientSet clientset.Interface, getPodsAssignedToNode podutil.GetPodsAssignedToNodeFunc) *evictions.PodEvictor {
evictionPolicyGroupVersion, err := eutils.SupportEviction(clientSet)
if err != nil || len(evictionPolicyGroupVersion) == 0 {
t.Fatalf("Error creating eviction policy group: %v", err)
@@ -1584,7 +1583,6 @@ func initPodEvictorOrFail(t *testing.T, clientSet clientset.Interface, getPodsAs
false,
nil,
nil,
nodes,
false,
eventRecorder,
)