e2e framework: don't fail when DumpAllNamespaceInfo is nil

It is set in all of the test/e2e* suites, but not in the ginkgo output
tests. This check is needed before adding a test case there which would trigger
this nil pointer access.
This commit is contained in:
Patrick Ohly 2022-11-02 18:07:47 +01:00
parent bc6afee049
commit 73b60ba769

View File

@ -268,6 +268,9 @@ func (f *Framework) dumpNamespaceInfo() {
if !TestContext.DumpLogsOnFailure {
return
}
if f.DumpAllNamespaceInfo == nil {
return
}
ginkgo.By("dump namespace information after failure", func() {
if !f.SkipNamespaceCreation {
for _, ns := range f.namespacesToDelete {