From 9e24680d0b3970a59588d572fda15001d2c294aa Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Tue, 25 Oct 2022 21:48:43 -0400 Subject: [PATCH] test/integration/endpointslice: remove references to EndpointSliceTerminatingCondition feature gate Signed-off-by: Andrew Sy Kim --- .../endpointsliceterminating_test.go | 57 ++----------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/test/integration/endpointslice/endpointsliceterminating_test.go b/test/integration/endpointslice/endpointsliceterminating_test.go index 0eb897f1520..d03af12f541 100644 --- a/test/integration/endpointslice/endpointsliceterminating_test.go +++ b/test/integration/endpointslice/endpointsliceterminating_test.go @@ -27,69 +27,24 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/wait" - utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" clientset "k8s.io/client-go/kubernetes" - featuregatetesting "k8s.io/component-base/featuregate/testing" kubeapiservertesting "k8s.io/kubernetes/cmd/kube-apiserver/app/testing" "k8s.io/kubernetes/pkg/controller/endpointslice" - "k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/test/integration/framework" utilpointer "k8s.io/utils/pointer" ) -// TestEndpointSliceTerminating tests that terminating pods are NOT included in EndpointSlice when -// the feature gate EndpointSliceTerminatingCondition is off. If the gate is on, it tests that -// terminating endpoints are included but with the correct conditions set for ready, serving and terminating. +// TestEndpointSliceTerminating tests that terminating endpoints are included with the +// correct conditions set for ready, serving and terminating. func TestEndpointSliceTerminating(t *testing.T) { testcases := []struct { name string podStatus corev1.PodStatus expectedEndpoints []discovery.Endpoint - terminatingGate bool }{ { - name: "ready terminating pods not included, terminating gate off", - podStatus: corev1.PodStatus{ - Phase: corev1.PodRunning, - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodReady, - Status: corev1.ConditionTrue, - }, - }, - PodIP: "10.0.0.1", - PodIPs: []corev1.PodIP{ - { - IP: "10.0.0.1", - }, - }, - }, - expectedEndpoints: []discovery.Endpoint{}, - terminatingGate: false, - }, - { - name: "not ready terminating pods not included, terminating gate off", - podStatus: corev1.PodStatus{ - Phase: corev1.PodRunning, - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodReady, - Status: corev1.ConditionFalse, - }, - }, - PodIP: "10.0.0.1", - PodIPs: []corev1.PodIP{ - { - IP: "10.0.0.1", - }, - }, - }, - expectedEndpoints: []discovery.Endpoint{}, - terminatingGate: false, - }, - { - name: "ready terminating pods included, terminating gate on", + name: "ready terminating pods", podStatus: corev1.PodStatus{ Phase: corev1.PodRunning, Conditions: []corev1.PodCondition{ @@ -115,10 +70,9 @@ func TestEndpointSliceTerminating(t *testing.T) { }, }, }, - terminatingGate: true, }, { - name: "not ready terminating pods included, terminating gate on", + name: "not ready terminating pods", podStatus: corev1.PodStatus{ Phase: corev1.PodRunning, Conditions: []corev1.PodCondition{ @@ -144,14 +98,11 @@ func TestEndpointSliceTerminating(t *testing.T) { }, }, }, - terminatingGate: true, }, } for _, testcase := range testcases { t.Run(testcase.name, func(t *testing.T) { - defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testcase.terminatingGate)() - // Disable ServiceAccount admission plugin as we don't have serviceaccount controller running. server := kubeapiservertesting.StartTestServerOrDie(t, nil, []string{"--disable-admission-plugins=ServiceAccount"}, framework.SharedEtcd()) defer server.TearDownFn()