Unify command line namespace resolution
This change allows the namespace in kubeconfig to be overridden by specifying the namespace in the spec file. If namespace is explicitly provided in the command line flags and the spec file has a different namespace, this will cause an error.
This commit is contained in:
@@ -146,8 +146,8 @@ func NewTestFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
|
||||
Validator: func() (validation.Schema, error) {
|
||||
return t.Validator, t.Err
|
||||
},
|
||||
DefaultNamespace: func() (string, error) {
|
||||
return t.Namespace, t.Err
|
||||
DefaultNamespace: func() (string, bool, error) {
|
||||
return t.Namespace, false, t.Err
|
||||
},
|
||||
ClientConfig: func() (*client.Config, error) {
|
||||
return t.ClientConfig, t.Err
|
||||
@@ -200,8 +200,8 @@ func NewAPIFactory() (*cmdutil.Factory, *testFactory, runtime.Codec) {
|
||||
Validator: func() (validation.Schema, error) {
|
||||
return t.Validator, t.Err
|
||||
},
|
||||
DefaultNamespace: func() (string, error) {
|
||||
return t.Namespace, t.Err
|
||||
DefaultNamespace: func() (string, bool, error) {
|
||||
return t.Namespace, false, t.Err
|
||||
},
|
||||
ClientConfig: func() (*client.Config, error) {
|
||||
return t.ClientConfig, t.Err
|
||||
|
Reference in New Issue
Block a user