From 4e758c18e8279e98c2292fc3410e62b793810b8b Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 14:19:19 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): inline p12 pod creation --- .../plugins/removeduplicates/removeduplicates_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index 976aac27d..e29b4de32 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -98,9 +98,6 @@ func TestFindDuplicatePods(t *testing.T) { // A Critical Pod. // Three Pods in the "test" Namespace, bound to same ReplicaSet. 2 should be evicted. // Same owners, but different images - p12 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("p12", "different-images", func(pod *v1.Pod) { - pod.Spec.Containers[0].Image = "bar" - }) // Multiple containers p13 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("p13", "different-images", func(pod *v1.Pod) { pod.Spec.Containers = append(pod.Spec.Containers, v1.Container{ @@ -266,7 +263,11 @@ func TestFindDuplicatePods(t *testing.T) { pods: []*v1.Pod{ buildTestPodWithRSOwnerRefWithNamespaceForNode1("p11", "different-images", func(pod *v1.Pod) { pod.Spec.Containers[0].Image = "foo" - }), p12}, + }), + buildTestPodWithRSOwnerRefWithNamespaceForNode1("p12", "different-images", func(pod *v1.Pod) { + pod.Spec.Containers[0].Image = "bar" + }), + }, nodes: []*v1.Node{node1, node2}, expectedEvictedPodCount: 0, },