diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 1f3a962a6af..33c786277d2 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -187,7 +187,9 @@ func (f *Framework) TContext(ctx context.Context) ktesting.TContext { } tCtx := ktesting.InitCtx(ctx, f /* intentionally using f here and not f.TB because f overrides some methods */) tCtx = tCtx.WithClients(f.clientConfig, f.restMapper, f.ClientSet, f.DynamicClient, apiextensions.NewForConfigOrDie(f.clientConfig)) - tCtx = tCtx.WithNamespace(f.Namespace.Name) + if f.Namespace != nil { + tCtx = tCtx.WithNamespace(f.Namespace.Name) + } tCtx = ensureLogger(tCtx) return tCtx }