Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear kubens selection #430

Open
tunix opened this issue Oct 10, 2024 · 2 comments
Open

Clear kubens selection #430

tunix opened this issue Oct 10, 2024 · 2 comments

Comments

@tunix
Copy link

tunix commented Oct 10, 2024

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.

@ahmetb
Copy link
Owner

ahmetb commented Oct 11, 2024

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.

@tunix
Copy link
Author

tunix commented Oct 11, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants