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

Add Initial Unit Tests For StatefulSets

This commit is contained in:
Sean Malloy
2021-03-23 00:03:36 -05:00
parent 56e4daccaf
commit 92740a25d4
2 changed files with 27 additions and 0 deletions

View File

@@ -236,6 +236,21 @@ func TestIsEvictable(t *testing.T) {
evictLocalStoragePods: false,
priorityThreshold: &lowPriority,
result: true,
}, {
pod: test.BuildTestPod("p16", 400, 0, n1.Name, nil),
runBefore: func(pod *v1.Pod) {
pod.ObjectMeta.OwnerReferences = test.GetStatefulSetOwnerRefList()
},
evictLocalStoragePods: false,
result: true,
}, {
pod: test.BuildTestPod("p17", 400, 0, n1.Name, nil),
runBefore: func(pod *v1.Pod) {
pod.Annotations = map[string]string{"descheduler.alpha.kubernetes.io/evict": "true"}
pod.ObjectMeta.OwnerReferences = test.GetStatefulSetOwnerRefList()
},
evictLocalStoragePods: false,
result: true,
},
}