From d96ad8d5703daf4f63f1c7d09e049da6177d7a2f Mon Sep 17 00:00:00 2001 From: nikhiljindal Date: Wed, 5 Oct 2016 12:45:19 -0700 Subject: [PATCH] Delete federation namespace after the test completes --- test/e2e/framework/framework.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index b6dcfc9f778..a2a87400d0e 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -269,6 +269,10 @@ func (f *Framework) BeforeEach() { } func (f *Framework) deleteFederationNs() { + if !f.federated { + // Nothing to do if this is not a federation setup. + return + } ns := f.FederationNamespace By(fmt.Sprintf("Destroying federation namespace %q for this suite.", ns.Name)) timeout := 5 * time.Minute @@ -327,10 +331,7 @@ func (f *Framework) AfterEach() { } } // Delete the federation namespace. - // TODO(nikhiljindal): Uncomment this, once https://github.com/kubernetes/kubernetes/issues/31077 is fixed. - // In the meantime, we will have these extra namespaces in all clusters. - // Note: this will not cause any failure since we create a new namespace for each test in BeforeEach(). - // f.deleteFederationNs() + f.deleteFederationNs() } else { Logf("Found DeleteNamespace=false, skipping namespace deletion!") }