mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-06-27 07:46:49 +00:00
Check correct variable after current namespace retrieval (#287)
This commit is contained in:
parent
438ba19fb0
commit
767218a9a6
@ -51,8 +51,8 @@ func switchNamespace(kc *kubeconfig.Kubeconfig, ns string) (string, error) {
|
||||
return "", errors.New("current-context is not set")
|
||||
}
|
||||
curNS, err := kc.NamespaceOfContext(ctx)
|
||||
if ctx == "" {
|
||||
return "", errors.New("failed to get current namespace")
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to get current namespace")
|
||||
}
|
||||
|
||||
f := NewNSFile(ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user