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

fix(unit-test): add necessary ownerRef to the pod.

This commit is contained in:
zhifei92
2024-06-21 19:12:40 +08:00
parent cdbd101eae
commit ae15fed7e7
4 changed files with 31 additions and 8 deletions

View File

@@ -115,6 +115,7 @@ func TestHighNodeUtilization(t *testing.T) {
}),
test.BuildTestPod("p2", 400, 0, n1NodeName, func(pod *v1.Pod) {
// A Critical Pod.
test.SetNormalOwnerRef(pod)
pod.Namespace = "kube-system"
priority := utils.SystemCriticalPriority
pod.Spec.Priority = &priority
@@ -167,6 +168,7 @@ func TestHighNodeUtilization(t *testing.T) {
// These won't be evicted.
test.BuildTestPod("p2", 400, 0, n1NodeName, func(pod *v1.Pod) {
// A Critical Pod.
test.SetNormalOwnerRef(pod)
pod.Namespace = "kube-system"
priority := utils.SystemCriticalPriority
pod.Spec.Priority = &priority