@@ -465,11 +465,6 @@ func (s *Scaffold) afterEach() {
465465 defer GinkgoRecover ()
466466 s .DeleteGatewayGroup (s .gatewaygroupid )
467467
468- // Clean up all additional gateway groups
469- for gatewayGroupID := range s .additionalGatewayGroups {
470- s .DeleteGatewayGroup (gatewayGroupID )
471- }
472-
473468 if CurrentSpecReport ().Failed () {
474469 if os .Getenv ("TEST_ENV" ) == "CI" {
475470 _ , _ = fmt .Fprintln (GinkgoWriter , "Dumping namespace contents" )
@@ -485,13 +480,8 @@ func (s *Scaffold) afterEach() {
485480
486481 // Delete all additional namespaces
487482 for _ , resources := range s .additionalGatewayGroups {
488- err := k8s .DeleteNamespaceE (s .t , & k8s.KubectlOptions {
489- ConfigPath : s .opts .Kubeconfig ,
490- Namespace : resources .Namespace ,
491- }, resources .Namespace )
492- if err != nil {
493- s .Logf ("failed to delete additional namespace %s: %v" , resources .Namespace , err )
494- }
483+ err := s .CleanupAdditionalGatewayGroup (resources .GatewayGroupID )
484+ Expect (err ).NotTo (HaveOccurred (), "cleaning up additional gateway group" )
495485 }
496486
497487 // if the test case is successful, just delete namespace
0 commit comments