jordanwilson230 / kubectl-plugins

A Collection of Plugins for kubectl Integration (exec as any user, context switching, etc).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSH plugin fails if no namespace is set

structurefall opened this issue · comments

If the namespace preference isn't set, the SSH plugin fails as such:


Connecting...
Pod: podname
User: root
Container:containername
Command:/bin/sh

Error: unknown command "value>" for "kubectl"
Run 'kubectl --help' for usage.
unknown command "value>" for "kubectl"
Error: unknown command "value>" for "kubectl"
Run 'kubectl --help' for usage.
unknown command "value>" for "kubectl"
/Users/username/.kube/plugins/jordanwilson230/kubectl-ssh: line 66: no: No such file or directory

The query on line 44 returns <no value> in this case, which causes the problem. It's a pretty easy fix to just have it default to default, which would solve the problem.

@structurefall thanks for the feedback! I think it best to be explicit or fail regarding the environment/namespace that one's working in. This essentially follows the same model when working with any kubectl command. I'll close #4 for now, but I'd certainly be open to a namespace flag being passed as an alternative. What do you think?

Yeah, a namespace flag also seems reasonable, agreed.