1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 21:31:18 +01:00

refactor(TestRemovePodsViolatingNodeAffinity): apply unit test convention for unschedulableNodeWithLabels

This commit is contained in:
Jan Chaloupka
2025-12-15 14:30:27 +01:00
parent 8fe74c7a0c
commit 691a1da43b

View File

@@ -45,9 +45,10 @@ func TestRemovePodsViolatingNodeAffinity(t *testing.T) {
nodeWithoutLabels := buildTestNode("nodeWithoutLabels", nil)
unschedulableNodeWithLabels := buildTestNode("unschedulableNodeWithLabels", nil)
unschedulableNodeWithLabels.Labels[nodeLabelKey] = nodeLabelValue
unschedulableNodeWithLabels.Spec.Unschedulable = true
unschedulableNodeWithLabels := buildTestNode("unschedulableNodeWithLabels", func(node *v1.Node) {
node.Labels[nodeLabelKey] = nodeLabelValue
node.Spec.Unschedulable = true
})
addPodsToNode := func(node *v1.Node, deletionTimestamp *metav1.Time, affinityType string) []*v1.Pod {
podWithNodeAffinity := test.BuildTestPod("podWithNodeAffinity", 100, 0, node.Name, nil)