From 691a1da43ba6c495a9ade64538a7f7a4a2faa500 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 15 Dec 2025 14:30:27 +0100 Subject: [PATCH] refactor(TestRemovePodsViolatingNodeAffinity): apply unit test convention for unschedulableNodeWithLabels --- .../removepodsviolatingnodeaffinity/node_affinity_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity_test.go b/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity_test.go index ae5d1330f..2da00cee2 100644 --- a/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity_test.go +++ b/pkg/framework/plugins/removepodsviolatingnodeaffinity/node_affinity_test.go @@ -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)