@@ -34,7 +34,6 @@ import (
3434 "github.com/gruntwork-io/terratest/modules/testing"
3535 . "github.com/onsi/ginkgo/v2"
3636 . "github.com/onsi/gomega"
37- "github.com/stretchr/testify/require"
3837 corev1 "k8s.io/api/core/v1"
3938 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4039 "k8s.io/apimachinery/pkg/util/wait"
@@ -463,17 +462,15 @@ func (s *Scaffold) afterEach() {
463462 if output != "" {
464463 _ , _ = fmt .Fprintln (GinkgoWriter , output )
465464 }
466-
467- output , _ = k8s .RunKubectlAndGetOutputE (GinkgoT (), s .kubectlOptions , "logs" , "--all-containers" )
468- if output != "" {
469- require .NoError (GinkgoT (), os .WriteFile ("../../ingress-controller-logs.log" , []byte (output ), 0644 ))
470- }
465+ _ , _ = fmt .Fprintf (GinkgoWriter , "s.namespace: %s\n " , s .namespace )
471466 }
472467 }
473468
474469 // if the test case is successful, just delete namespace
475- err := k8s .DeleteNamespaceE (s .t , s .kubectlOptions , s .namespace )
476- Expect (err ).NotTo (HaveOccurred (), "deleting namespace " + s .namespace )
470+ if ! CurrentSpecReport ().Failed () {
471+ err := k8s .DeleteNamespaceE (s .t , s .kubectlOptions , s .namespace )
472+ Expect (err ).NotTo (HaveOccurred (), "deleting namespace " + s .namespace )
473+ }
477474
478475 for _ , f := range s .finalizers {
479476 runWithRecover (f )
0 commit comments