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

Setting default namespace #19

Closed
akhy opened this issue Mar 14, 2018 · 5 comments
Closed

Setting default namespace #19

akhy opened this issue Mar 14, 2018 · 5 comments

Comments

@akhy
Copy link

akhy commented Mar 14, 2018

I think this feature would be very useful when we're working in certain namespace. For example, we would execute kube-prompt --namespace staging to set default namespace to staging if not set explicitly in the prompt. So we don't need to type --namespace option for each commands.

Bonus:
Taking more generic approach, it would be better if kube-prompt CLI accept options from original kubectl command as defaults. For example, executing kube-prompt --namespace dev -o wide sets default namespace to dev and output format to wide for any compatible commands. (i.e. it behaves like currying/partial application in functional programming)

@c-bata
Copy link
Owner

c-bata commented Feb 21, 2019

Fix this behavior at #42

Determine the namespace to use after merged this PR:

  1. Use a command-line flag if it exists --namespace (or -n).
  2. Use the namespace of current context.

@c-bata
Copy link
Owner

c-bata commented Feb 21, 2019

Hi @akhy. This terrible behavior around namespace is fixed at v1.0.6. Please update your kube-prompt.

https://github.com/c-bata/kube-prompt/releases/tag/v1.0.6

@c-bata c-bata closed this as completed Feb 21, 2019
@sheerun
Copy link

sheerun commented Nov 28, 2019

@c-bata Is it possible to change defualt namespace inside session?

@c-bata
Copy link
Owner

c-bata commented Nov 28, 2019

Currently you can't. But if everyone want this feature, it might be worth to consider it. The most concerned thing is that need to design magic command syntax like:

>>> !namespace <yournamespace>  # magic command starts with "!"
Changed namespace: <yournamespace>
>>>

@mitchellmaler
Copy link

@c-bata I am in favor of switching the namespace and even the context in session. Could even do slash instead of !. /namespace

!context "context autocomplete"
!namespace "namespace autocomplete"

I tend to switch between multiple clusters and namespaces a lot so being able to switch these easily would be awesome.

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

4 participants