Skip to content

Commit 541b4e4

Browse files
authored
Merge pull request kubernetes#85542 from schrodit/e2e-dump-ns
Dump namespace if the namespace could not be cleaned up
2 parents 4000732 + c3c7ea2 commit 541b4e4

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
@@ -332,6 +332,11 @@ func (f *Framework) AfterEach() {
332332
if err := f.ClientSet.CoreV1().Namespaces().Delete(ns.Name, nil); err != nil {
333333
if !apierrors.IsNotFound(err) {
334334
nsDeletionErrors[ns.Name] = err
335+
336+
// Dump namespace if we are unable to delete the namespace and the dump was not already performed.
337+
if !ginkgo.CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
338+
DumpAllNamespaceInfo(f.ClientSet, ns.Name)
339+
}
335340
} else {
336341
Logf("Namespace %v was already deleted", ns.Name)
337342
}

0 commit comments

Comments
 (0)