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

refactor(TestPodAntiAffinity): deduplicate setting Labels for foo1-bar1

This commit is contained in:
Jan Chaloupka
2025-12-15 13:38:58 +01:00
parent 90672630da
commit fa427a2b37

View File

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