mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
refactor(TestFindDuplicatePods): have a pod fully created through BuildTestPod without any edits
This commit is contained in:
@@ -160,8 +160,13 @@ func TestFindDuplicatePods(t *testing.T) {
|
|||||||
"datacenter": "west",
|
"datacenter": "west",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
p17 := test.BuildTestPod("NOT2", 100, 0, node1.Name, nil)
|
p17 := test.BuildTestPod("NOT2", 100, 0, node1.Name, func(pod *v1.Pod) {
|
||||||
p17.Namespace = "node-fit"
|
pod.Namespace = "node-fit"
|
||||||
|
pod.ObjectMeta.OwnerReferences = ownerRef3
|
||||||
|
pod.Spec.NodeSelector = map[string]string{
|
||||||
|
"datacenter": "west",
|
||||||
|
}
|
||||||
|
})
|
||||||
p18 := test.BuildTestPod("TARGET", 100, 0, node1.Name, nil)
|
p18 := test.BuildTestPod("TARGET", 100, 0, node1.Name, nil)
|
||||||
p18.Namespace = "node-fit"
|
p18.Namespace = "node-fit"
|
||||||
|
|
||||||
@@ -177,13 +182,8 @@ func TestFindDuplicatePods(t *testing.T) {
|
|||||||
|
|
||||||
// ### Non-evictable Pods ###
|
// ### Non-evictable Pods ###
|
||||||
|
|
||||||
p17.ObjectMeta.OwnerReferences = ownerRef3
|
|
||||||
p18.ObjectMeta.OwnerReferences = ownerRef3
|
p18.ObjectMeta.OwnerReferences = ownerRef3
|
||||||
|
|
||||||
p17.Spec.NodeSelector = map[string]string{
|
|
||||||
"datacenter": "west",
|
|
||||||
}
|
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
description string
|
description string
|
||||||
pods []*v1.Pod
|
pods []*v1.Pod
|
||||||
|
|||||||
Reference in New Issue
Block a user