mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
refactor(TestPodAntiAffinity): deduplicate setting Labels for foo1-bar1
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user