Merge pull request #12979 from CalvinKrist/fix-namespace-on-kube-error

12124: Fix namespace on kubeconfig error
pull/12948/merge
Joe Julian 8 months ago committed by GitHub
commit c6beb169d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save