From 570c2d70365702475b0c531c2aac51bb62a833b8 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Sat, 7 Jan 2023 08:46:35 +0000 Subject: [PATCH] cleanup(nodeaffinity): remove impossible scenario from test cases --- .../nodeaffinity/node_affinity_test.go | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go index e372779ae85..dc815ee6674 100644 --- a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go +++ b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go @@ -217,42 +217,6 @@ func TestNodeAffinity(t *testing.T) { }, wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod), }, - { - name: "Pod with a nil []NodeSelectorTerm in affinity, can't match the node's labels and won't schedule onto the node", - pod: &v1.Pod{ - Spec: v1.PodSpec{ - Affinity: &v1.Affinity{ - NodeAffinity: &v1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ - NodeSelectorTerms: nil, - }, - }, - }, - }, - }, - labels: map[string]string{ - "foo": "bar", - }, - wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod), - }, - { - name: "Pod with an empty []NodeSelectorTerm in affinity, can't match the node's labels and won't schedule onto the node", - pod: &v1.Pod{ - Spec: v1.PodSpec{ - Affinity: &v1.Affinity{ - NodeAffinity: &v1.NodeAffinity{ - RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{ - NodeSelectorTerms: []v1.NodeSelectorTerm{}, - }, - }, - }, - }, - }, - labels: map[string]string{ - "foo": "bar", - }, - wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, ErrReasonPod), - }, { name: "Pod with empty MatchExpressions is not a valid value will match no objects and won't schedule onto the node", pod: &v1.Pod{