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:
Kris Rousey
2015-06-26 13:49:34 -07:00
parent 588bc9beb5
commit ffa764d60b
23 changed files with 120 additions and 57 deletions

View File

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