From 660e2dba4019cd9c0324438ac4f6be6c0ddf520c Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 12:32:16 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): have a pod fully created through BuildTestPod without any edits --- .../plugins/removeduplicates/removeduplicates_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index f835f0251..e66da0009 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -130,8 +130,11 @@ func TestFindDuplicatePods(t *testing.T) { pod.Spec.Containers[0].Image = "foo" pod.ObjectMeta.OwnerReferences = ownerRef1 }) - p12 := test.BuildTestPod("p12", 100, 0, node1.Name, nil) - p12.Namespace = "different-images" + p12 := test.BuildTestPod("p12", 100, 0, node1.Name, func(pod *v1.Pod) { + pod.Namespace = "different-images" + pod.Spec.Containers[0].Image = "bar" + pod.ObjectMeta.OwnerReferences = ownerRef1 + }) p13 := test.BuildTestPod("p13", 100, 0, node1.Name, nil) p13.Namespace = "different-images" p14 := test.BuildTestPod("p14", 100, 0, node1.Name, nil) @@ -157,9 +160,6 @@ func TestFindDuplicatePods(t *testing.T) { // ### Non-evictable Pods ### - p12.Spec.Containers[0].Image = "bar" - p12.ObjectMeta.OwnerReferences = ownerRef1 - // Multiple containers p13.ObjectMeta.OwnerReferences = ownerRef1 p13.Spec.Containers = append(p13.Spec.Containers, v1.Container{