mirror of
https://github.com/helm/helm.git
synced 2026-08-08 09:01:25 +00:00
Merge pull request #12979 from CalvinKrist/fix-namespace-on-kube-error
12124: Fix namespace on kubeconfig error
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user