From 0e568238657b660ccb4fbe02e389578bb1853495 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 15 Dec 2025 13:24:09 +0100 Subject: [PATCH] refactor(TestPodAntiAffinity): ensure p11 is created only through apply argument --- .../pod_antiaffinity_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go index ed373090c..b0e9a4c9a 100644 --- a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go +++ b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go @@ -114,15 +114,16 @@ func TestPodAntiAffinity(t *testing.T) { test.SetPodAntiAffinity(pod, "foo", "bar") pod.DeletionTimestamp = &metav1.Time{} }) - p11 := buildTestPod("p11", nodeName5, nil) + p11 := buildTestPod("p11", nodeName5, func(pod *v1.Pod) { + test.SetNormalOwnerRef(pod) + pod.Labels = map[string]string{"foo": "bar"} + }) criticalPriority := utils.SystemCriticalPriority nonEvictablePod := buildTestPodForNode1("non-evict", func(pod *v1.Pod) { pod.Spec.Priority = &criticalPriority }) - p11.Labels = map[string]string{"foo": "bar"} nonEvictablePod.Labels = map[string]string{"foo": "bar"} - test.SetNormalOwnerRef(p11) var uint1 uint = 1 var uint3 uint = 3