mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
resttest: Modify TestContext to have namespace in context
Previously, if a request is clusterscoped, the context that was returned has no namespace, ideally the context should contain a metav1.NamespaceNone as the namespace even for cluster scoped requests. Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
parent
40c2d04946
commit
412626f402
@ -105,9 +105,6 @@ func (t *Tester) TestNamespace() string {
|
||||
// TestContext returns a namespaced context that will be used when making storage calls.
|
||||
// Namespace is determined by TestNamespace()
|
||||
func (t *Tester) TestContext() context.Context {
|
||||
if t.clusterScope {
|
||||
return genericapirequest.NewContext()
|
||||
}
|
||||
return genericapirequest.WithNamespace(genericapirequest.NewContext(), t.TestNamespace())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user