From ad81bf5a30ce7280d8ec2eaeebab8be0a3ef1233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Werner?= Date: Thu, 19 Jan 2023 16:13:04 +0100 Subject: [PATCH] Always clean out the Helm deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hervé Werner --- test/e2e/admission/admission.go | 5 ----- test/e2e/endpointslices/topology.go | 6 ------ test/e2e/framework/framework.go | 6 +++++- test/e2e/settings/namespace_selector.go | 4 ---- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/test/e2e/admission/admission.go b/test/e2e/admission/admission.go index 516ffee14..f1cf69688 100644 --- a/test/e2e/admission/admission.go +++ b/test/e2e/admission/admission.go @@ -48,11 +48,6 @@ var _ = framework.IngressNginxDescribeSerial("[Admission] admission controller", f.NewSlowEchoDeployment() }) - ginkgo.AfterEach(func() { - err := f.UninstallChart() - assert.Nil(ginkgo.GinkgoT(), err, "uninstalling helm chart") - }) - ginkgo.It("reject ingress with global-rate-limit annotations when memcached is not configured", func() { host := "admission-test" diff --git a/test/e2e/endpointslices/topology.go b/test/e2e/endpointslices/topology.go index c3365dbad..7cc67cedb 100644 --- a/test/e2e/endpointslices/topology.go +++ b/test/e2e/endpointslices/topology.go @@ -40,12 +40,6 @@ var _ = framework.IngressNginxDescribeSerial("[TopologyHints] topology aware rou f.NewEchoDeployment(framework.WithDeploymentReplicas(2), framework.WithSvcTopologyAnnotations()) }) - ginkgo.AfterEach(func() { - // we need to uninstall chart because of clusterRole (controller.scope.enabled=false) which is not destroyed with namespace - err := f.UninstallChart() - assert.Nil(ginkgo.GinkgoT(), err, "uninstalling helm chart") - }) - ginkgo.It("should return 200 when service has topology hints", func() { annotations := make(map[string]string) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index f06aa8dbc..5053150c0 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -150,7 +150,11 @@ func (f *Framework) AfterEach() { defer func(kubeClient kubernetes.Interface, ingressclass string) { defer ginkgo.GinkgoRecover() - err := deleteIngressClass(kubeClient, ingressclass) + + err := f.UninstallChart() + assert.Nil(ginkgo.GinkgoT(), err, "uninstalling helm chart") + + err = deleteIngressClass(kubeClient, ingressclass) assert.Nil(ginkgo.GinkgoT(), err, "deleting IngressClass") }(f.KubeClientSet, f.IngressClass) diff --git a/test/e2e/settings/namespace_selector.go b/test/e2e/settings/namespace_selector.go index 236460c5d..3bf856566 100644 --- a/test/e2e/settings/namespace_selector.go +++ b/test/e2e/settings/namespace_selector.go @@ -56,10 +56,6 @@ var _ = framework.IngressNginxDescribeSerial("[Flag] watch namespace selector", ginkgo.AfterEach(func() { cleanupNamespace(notMatchedNs) cleanupNamespace(matchedNs) - - // we need to uninstall chart because of clusterRole (controller.scope.enabled=false) which is not destroyed with namespace - err := f.UninstallChart() - assert.Nil(ginkgo.GinkgoT(), err, "uninstalling helm chart") }) ginkgo.Context("With specific watch-namespace-selector flags", func() {