From fa427a2b376797acca44db59a5d100091ce3c1dd Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 15 Dec 2025 13:38:58 +0100 Subject: [PATCH] refactor(TestPodAntiAffinity): deduplicate setting Labels for foo1-bar1 --- .../pod_antiaffinity_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go index 9edace273..8c3070b47 100644 --- a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go +++ b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go @@ -75,6 +75,10 @@ func setLabelsFooBar(pod *v1.Pod) { pod.Labels = map[string]string{"foo": "bar"} } +func setLabelsFoo1Bar1(pod *v1.Pod) { + pod.Labels = map[string]string{"foo1": "bar1"} +} + func TestPodAntiAffinity(t *testing.T) { p1 := buildTestPodForNode1("p1", func(pod *v1.Pod) { @@ -107,7 +111,7 @@ func TestPodAntiAffinity(t *testing.T) { }) p7 := buildTestPodForNode1("p7", func(pod *v1.Pod) { test.SetNormalOwnerRef(pod) - pod.Labels = map[string]string{"foo1": "bar1"} + setLabelsFoo1Bar1(pod) setPodAntiAffinityFooBar(pod) test.SetPodPriority(pod, 0) })