Open cgilling opened 6 years ago
Thanks for using kube-prompt.
kube-prompt just wraps kubectl like: https://github.com/c-bata/kube-prompt/blob/master/kube/executor.go#L20-L27
So It looks that your problem is no relevant to namespace. And your problem is also occurred when just executed following command directly. Can you try this?
$ kubectl describe pod canopy-2965694291-f5f6c
I looked into the code a bit and it seems like the issue is that the completer always uses the default namespace when looking pods (see here)
Where as since the executor is shelling out to kubectl
it will use the default namespace as setup by the current context that is being used.
Looks like this was fixed in 49b6437a0dfe633dd2cef51bf1d67b7b8637b75d.
@cgilling - I agree that when working outside of the default context, some of the features provided by kube-prompt break. ex. ">>> -n myNamespace get po" Normally cube-prompt would allow me to tab complete the 'get' verb, and then suggest po
, then provide a list of pods, but it doesn't recognize the -n
.
I've gotten around this by simply setting the default namespace in my context using: kubectl config set-context $(kubectl config current-context) --namespace=<insert-namespace-name-here>
OR in the kube-prompt paradigm, 'config set-context $(kubectl config current-context) --namespace=
Then I can work in my most used namespace and enjoy the creature comforts provided by this very handy tool ;)
It sounds like several people here, like me, need to work in multiple namespaces, and this workaround doesn't solve for rapid namespace changes, so I think better namespace support in kube-prompt would be a worth while improvement.
Keep up the good work @c-bata !
Cheers
Hi there! As @carolynvs says, this problem has already fixed at master branch. But there are some important changes I want to like:
So please wait until few weeks later. I promised kube-prompt will be really better from the next release.
great thanks
First off, thanks for writing this tool, it looks like it should be pretty helpful. Excited to start using it more.
This is for version 1.0.1:
As you can see below my context is registered to use the
seu
namespace by default, but the completions are from thedefault
namespace. But then when the actual command is run it uses the proper namespace, and therefore can't find my auto completed pod.