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

refactor(node_taint_test): apply pod single creation convention for p12

This commit is contained in:
Jan Chaloupka
2025-12-15 16:44:46 +01:00
parent 4171af7e8a
commit 0580b5942c

View File

@@ -174,8 +174,12 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
p11 := buildTestPod("p11", nodeName2, func(pod *v1.Pod) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
})
p12 := buildTestPod("p11", nodeName2, nil)
p12.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
p12 := buildTestPod("p11", nodeName2, func(pod *v1.Pod) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
pod.Spec.NodeSelector = map[string]string{
"datacenter": "west",
}
})
// The following 4 pods won't get evicted.
// A Critical Pod.
@@ -183,10 +187,6 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
// A pod with local storage.
// A Mirror Pod.
p12.Spec.NodeSelector = map[string]string{
"datacenter": "west",
}
p13 := buildTestPod("p13", nodeName5, nil)
p13.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
// node5 has PreferNoSchedule:testTaint1=test1, so the p13 has to have