Merge pull request #136320 from pohly/e2e-framework-tcontext-namespace-fix

E2E framework: fix nil pointer crash in TContext
This commit is contained in:
Kubernetes Prow Robot
2026-01-19 17:41:13 +05:30
committed by GitHub

View File

@@ -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
}