Skip to content

Commit c3c7ea2

Browse files
author
Tim Schrodi
committed
Dump namespace if the namespace could not be cleaned up
1 parent d87c921 commit c3c7ea2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/e2e/framework/framework.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ func (f *Framework) AfterEach() {
334334
if err := f.ClientSet.CoreV1().Namespaces().Delete(ns.Name, nil); err != nil {
335335
if !apierrors.IsNotFound(err) {
336336
nsDeletionErrors[ns.Name] = err
337+
338+
// Dump namespace if we are unable to delete the namespace and the dump was not already performed.
339+
if !ginkgo.CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
340+
DumpAllNamespaceInfo(f.ClientSet, ns.Name)
341+
}
337342
} else {
338343
Logf("Namespace %v was already deleted", ns.Name)
339344
}

0 commit comments

Comments
 (0)