mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
refactor(TestDefaultEvictor): replace system critical priority assignments with test.SetPodPriority
This commit is contained in:
@@ -483,8 +483,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
|
|||||||
pods: []*v1.Pod{
|
pods: []*v1.Pod{
|
||||||
buildTestPod("p12", n1.Name, func(pod *v1.Pod) {
|
buildTestPod("p12", n1.Name, func(pod *v1.Pod) {
|
||||||
test.SetNormalOwnerRef(pod)
|
test.SetNormalOwnerRef(pod)
|
||||||
priority := utils.SystemCriticalPriority
|
test.SetPodPriority(pod, utils.SystemCriticalPriority)
|
||||||
pod.Spec.Priority = &priority
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -493,8 +492,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
|
|||||||
pods: []*v1.Pod{
|
pods: []*v1.Pod{
|
||||||
buildTestPod("p13", n1.Name, func(pod *v1.Pod) {
|
buildTestPod("p13", n1.Name, func(pod *v1.Pod) {
|
||||||
test.SetNormalOwnerRef(pod)
|
test.SetNormalOwnerRef(pod)
|
||||||
priority := utils.SystemCriticalPriority
|
test.SetPodPriority(pod, utils.SystemCriticalPriority)
|
||||||
pod.Spec.Priority = &priority
|
|
||||||
pod.Annotations = map[string]string{
|
pod.Annotations = map[string]string{
|
||||||
evictPodAnnotationKey: "true",
|
evictPodAnnotationKey: "true",
|
||||||
}
|
}
|
||||||
@@ -529,8 +527,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
|
|||||||
pods: []*v1.Pod{
|
pods: []*v1.Pod{
|
||||||
buildTestPod("p16", n1.Name, func(pod *v1.Pod) {
|
buildTestPod("p16", n1.Name, func(pod *v1.Pod) {
|
||||||
test.SetNormalOwnerRef(pod)
|
test.SetNormalOwnerRef(pod)
|
||||||
priority := utils.SystemCriticalPriority
|
test.SetPodPriority(pod, utils.SystemCriticalPriority)
|
||||||
pod.Spec.Priority = &priority
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
evictSystemCriticalPods: true,
|
evictSystemCriticalPods: true,
|
||||||
@@ -542,8 +539,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
|
|||||||
buildTestPod("p16", n1.Name, func(pod *v1.Pod) {
|
buildTestPod("p16", n1.Name, func(pod *v1.Pod) {
|
||||||
test.SetNormalOwnerRef(pod)
|
test.SetNormalOwnerRef(pod)
|
||||||
setPodEvictAnnotation(pod)
|
setPodEvictAnnotation(pod)
|
||||||
priority := utils.SystemCriticalPriority
|
test.SetPodPriority(pod, utils.SystemCriticalPriority)
|
||||||
pod.Spec.Priority = &priority
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
evictSystemCriticalPods: true,
|
evictSystemCriticalPods: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user