Closed akhy closed 5 years ago
Fix this behavior at https://github.com/c-bata/kube-prompt/pull/42
Determine the namespace to use after merged this PR:
- Use a command-line flag if it exists
--namespace
(or-n
).- Use the namespace of current context.
Hi @akhy. This terrible behavior around namespace is fixed at v1.0.6. Please update your kube-prompt.
@c-bata Is it possible to change defualt namespace inside session?
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>
>>>
@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.
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 tostaging
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 originalkubectl
command as defaults. For example, executingkube-prompt --namespace dev -o wide
sets default namespace todev
and output format towide
for any compatible commands. (i.e. it behaves like currying/partial application in functional programming)