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

refactor(node_taint_test): inline node7

This commit is contained in:
Jan Chaloupka
2025-12-15 17:26:04 +01:00
parent b96a41a745
commit 57ed329feb

View File

@@ -114,8 +114,6 @@ func addTolerationToPod(pod *v1.Pod, key, value string, index int, effect v1.Tai
}
func TestDeletePodsViolatingNodeTaints(t *testing.T) {
node7 := buildTestNode(nodeName7, withBothTaints1)
p1 := buildTestPod("p1", nodeName1, func(pod *v1.Pod) {
test.SetNormalOwnerRef(pod)
addTolerationToPod(pod, "testTaint", "test", 1, v1.TaintEffectNoSchedule)
@@ -391,7 +389,9 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
{
description: "Pods tolerating included taints should not get evicted even with other taints present",
pods: []*v1.Pod{p1},
nodes: []*v1.Node{node7},
nodes: []*v1.Node{
buildTestNode(nodeName7, withBothTaints1),
},
includedTaints: []string{"testTaint1=test1"},
expectedEvictedPodCount: 0, // nothing gets evicted, as p1 tolerates the included taint, and taint "testingTaint1=testing1" is not included
},
@@ -416,7 +416,9 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) {
{
description: "Pods not tolerating all taints are evicted when includedTaints is empty",
pods: []*v1.Pod{p14, p15},
nodes: []*v1.Node{node7},
nodes: []*v1.Node{
buildTestNode(nodeName7, withBothTaints1),
},
expectedEvictedPodCount: 1, // includedTaints is empty so all taints are included. p15 tolerates both node taints and does not get evicted. p14 tolerate only one and gets evicted
},
}