mirror of https://github.com/helm/helm.git
Fix namespace on kubeconfig error
Signed-off-by: Calvin Krist <calvin.krist@yahoo.com>
This commit is contained in:
parent
14d0c13e9e
commit
214fb6eff3
|
|
@ -244,6 +244,9 @@ func (s *EnvSettings) Namespace() string {
|
|||
if ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil {
|
||||
return ns
|
||||
}
|
||||
if s.namespace != "" {
|
||||
return s.namespace
|
||||
}
|
||||
return "default"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,6 +111,14 @@ func TestEnvSettings(t *testing.T) {
|
|||
kubeTLSServer: "example.org",
|
||||
kubeInsecure: true,
|
||||
},
|
||||
{
|
||||
name: "invalid kubeconfig",
|
||||
ns: "testns",
|
||||
args: "--namespace=testns --kubeconfig=/path/to/fake/file",
|
||||
maxhistory: defaultMaxHistory,
|
||||
burstLimit: defaultBurstLimit,
|
||||
qps: defaultQPS,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Reference in New Issue