diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index 775611e64..9d17d320f 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -153,8 +153,13 @@ func TestFindDuplicatePods(t *testing.T) { "datacenter": "west", } }) - p16 := test.BuildTestPod("NOT1", 100, 0, node1.Name, nil) - p16.Namespace = "node-fit" + p16 := test.BuildTestPod("NOT1", 100, 0, node1.Name, func(pod *v1.Pod) { + pod.Namespace = "node-fit" + pod.ObjectMeta.OwnerReferences = ownerRef3 + pod.Spec.NodeSelector = map[string]string{ + "datacenter": "west", + } + }) p17 := test.BuildTestPod("NOT2", 100, 0, node1.Name, nil) p17.Namespace = "node-fit" p18 := test.BuildTestPod("TARGET", 100, 0, node1.Name, nil) @@ -172,13 +177,9 @@ func TestFindDuplicatePods(t *testing.T) { // ### Non-evictable Pods ### - p16.ObjectMeta.OwnerReferences = ownerRef3 p17.ObjectMeta.OwnerReferences = ownerRef3 p18.ObjectMeta.OwnerReferences = ownerRef3 - p16.Spec.NodeSelector = map[string]string{ - "datacenter": "west", - } p17.Spec.NodeSelector = map[string]string{ "datacenter": "west", }