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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user