You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if fish had completions for kubectl subcommands and resources, but is it really possible? Certainly we could do subcommands, but the resources vary from server to server.
This is similar to Gradle tasks. It looks like Gradle completions are done by running gradle tasks and parsing the output. We could do that with kubectl get, but doesn't that mean going over the network to the server and asking what resources it allows?
Alternatively, we could just have a static list of common resources.
Finally, kubectl has a built-in feature to generate completions for bash and zsh. Maybe support for fish should be added at that end instead. This would either require adding fish support to the cobra library (with would be great) or building a custom completion generator into kubectl itself.
Any other ideas? Whatever we decide, I'm eager to do the work for this and submit a PR.
Activity
xordspar0 commentedon Jan 11, 2019
I just found that there's an open PR in cobra that would allow kubectl to generate its own completions: spf13/cobra#754
Maybe it's better to let kubectl take care of this on its own? I'm not sure what fish's preference is for where completions live.
zanchey commentedon Jan 12, 2019
Definitely preferred upstream. That way they stay in sync with the features offered.
evanlucas commentedon Jan 20, 2019
@xordspar0 I maintain https://github.com/evanlucas/fish-kubectl-completions which works well for me. The goal is to eventually get it upstreamed into
kubectlitself, but that is still a ways off.zanchey commentedon Jan 26, 2019
Let's leave this to the upstream project.