1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 13:29:11 +01:00

refactor(TestPodAntiAffinity): ensure p11 is created only through apply argument

This commit is contained in:
Jan Chaloupka
2025-12-15 13:24:09 +01:00
parent ea80f7d307
commit 0e56823865

View File

@@ -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