mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-06-27 15:56: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")
|
return "", errors.New("current-context is not set")
|
||||||
}
|
}
|
||||||
curNS, err := kc.NamespaceOfContext(ctx)
|
curNS, err := kc.NamespaceOfContext(ctx)
|
||||||
if ctx == "" {
|
if err != nil {
|
||||||
return "", errors.New("failed to get current namespace")
|
return "", errors.Wrap(err, "failed to get current namespace")
|
||||||
}
|
}
|
||||||
|
|
||||||
f := NewNSFile(ctx)
|
f := NewNSFile(ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user