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

refactor(TestDefaultEvictor): replace manual owner reference assignments with test utilities

This commit is contained in:
Jan Chaloupka
2025-12-20 14:25:58 +01:00
parent 1df3ef5030
commit 674e463bc2

View File

@@ -356,7 +356,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
pods: []*v1.Pod{ pods: []*v1.Pod{
buildTestPod("p4", n1.Name, func(pod *v1.Pod) { buildTestPod("p4", n1.Name, func(pod *v1.Pod) {
setPodEvictAnnotation(pod) setPodEvictAnnotation(pod)
pod.ObjectMeta.OwnerReferences = test.GetReplicaSetOwnerRefList() test.SetRSOwnerRef(pod)
}), }),
}, },
result: true, result: true,
@@ -373,7 +373,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
pods: []*v1.Pod{ pods: []*v1.Pod{
buildTestPod("p19", n1.Name, func(pod *v1.Pod) { buildTestPod("p19", n1.Name, func(pod *v1.Pod) {
setPodEvictAnnotation(pod) setPodEvictAnnotation(pod)
pod.ObjectMeta.OwnerReferences = test.GetStatefulSetOwnerRefList() test.SetSSOwnerRef(pod)
}), }),
}, },
result: true, result: true,