mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-04-20 21:57:09 -04:00
E2E framework: fix nil pointer crash in TContext
Not all framework instances have a default namespace. TContext crashed for those.
This commit is contained in:
parent
6f93518c7f
commit
80cc14831e
1 changed files with 3 additions and 1 deletions
|
|
@ -180,7 +180,9 @@ var _ ktesting.ContextTB = &Framework{}
|
|||
func (f *Framework) TContext(ctx context.Context) ktesting.TContext {
|
||||
tCtx := ktesting.InitCtx(ctx, f)
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue