From d7766cccfd5c6a4b4cc898b1055f523171b2729d Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 14:22:22 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): inline p15 pod creation --- .../removeduplicates/removeduplicates_test.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index c126314b2..2a1d08afc 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -100,11 +100,6 @@ func TestFindDuplicatePods(t *testing.T) { // Same owners, but different images // Multiple containers // ### Pods Evictable Based On Node Fit ### - p15 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("p15", "node-fit", func(pod *v1.Pod) { - pod.Spec.NodeSelector = map[string]string{ - "datacenter": "west", - } - }) p16 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("NOT1", "node-fit", func(pod *v1.Pod) { pod.Spec.NodeSelector = map[string]string{ "datacenter": "west", @@ -306,8 +301,16 @@ func TestFindDuplicatePods(t *testing.T) { nodefit: true, }, { - description: "Three pods in the `node-fit` Namespace, bound to same ReplicaSet, all with a nodeSelector. Only node available has an incorrect node label, and nodeFit set to true. 0 should be evicted.", - pods: []*v1.Pod{p15, p16, p17}, + description: "Three pods in the `node-fit` Namespace, bound to same ReplicaSet, all with a nodeSelector. Only node available has an incorrect node label, and nodeFit set to true. 0 should be evicted.", + pods: []*v1.Pod{ + buildTestPodWithRSOwnerRefWithNamespaceForNode1("p15", "node-fit", func(pod *v1.Pod) { + pod.Spec.NodeSelector = map[string]string{ + "datacenter": "west", + } + }), + p16, + p17, + }, nodes: []*v1.Node{node1, node4}, expectedEvictedPodCount: 0, nodefit: true,