kubectx
kubectx copied to clipboard
Clear kubens selection
Hi 👋🏻 ,
Is it possible to have a subcommand like clear for kubens where it clears current namespace?
This seems to be possible with kubectl config set-context --current --namespace=""
Maybe we can even do kubens "" but it prints an error that it couldn't find that namespace.
kubens -f "" might work.
I see we have unset operation for ctx but not namespace. We could add, I'm surprised this never came up before.
Unfortunetely that doesn't work:
kubens -f ""
error: too many flags
USAGE:
kubens : list the namespaces in the current context
kubens <NAME> : change the active namespace of current context
kubens - : switch to the previous namespace in this context
kubens -c, --current : show the current namespace
kubens -h,--help : show this message
How about kubens -u just like kubectx?
There is a -u flag for kubectx, but not for kubens.