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

Add kubectl completions #5516

Closed
xordspar0 opened this issue Jan 11, 2019 · 4 comments
Closed

Add kubectl completions #5516

xordspar0 opened this issue Jan 11, 2019 · 4 comments

Comments

@xordspar0
Copy link

xordspar0 commented Jan 11, 2019

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.

@xordspar0
Copy link
Author

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
Copy link
Member

zanchey commented Jan 12, 2019

Definitely preferred upstream. That way they stay in sync with the features offered.

@evanlucas
Copy link

@xordspar0 I maintain https://github.com/evanlucas/fish-kubectl-completions which works well for me. The goal is to eventually get it upstreamed into kubectl itself, but that is still a ways off.

@zanchey
Copy link
Member

zanchey commented Jan 26, 2019

Let's leave this to the upstream project.

@zanchey zanchey closed this as completed Jan 26, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants