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:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user