kubernetes-sigs / krew

📦 Find and install kubectl plugins
https://krew.sigs.k8s.io
Apache License 2.0
6.41k stars 370 forks source link

Proposal: Installing an additional executable for plugin's completion script #812

Open predatorray opened 2 years ago

predatorray commented 2 years ago

Hi there, I am the maintainer of a krew plugin. Kubectl recently released a new feature to support shell completion for plugins in its latest alpha release v1.26.0-alpha.3. It requires an additional executable named kubectl_complete-<pluginName> present on $PATH.

As discussed in the pull request, krew does not provide a way to deliver this separate executable because bin: in the manifest yaml only expects one parameter. As a result, although I have implemented the completion script and managed to publish it to a homebrew tap simply by adding another bin.install (see: predatorray/homebrew-brew#5), I am still not able to release this feature to the users using krew.

I am wondering do we have any plan to support this feature, for example, by supporting multiple parameters under bin: or providing another parameter called completion?

ahmetb commented 2 years ago

Yeah we should add support. I wasn't aware kubectl implemented support for it, as it was mostly in design discussion phase. It may take a while for us to get this done, so please be patient. Design proposals for this are appreciated.

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 1 year ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

ahmetb commented 1 year ago

/lifecycle frozen

chisaato commented 1 year ago

Here are some workaound for zsh users before this complete.

https://github.com/kubernetes-sigs/krew/issues/810#issuecomment-1516664951

fredgate commented 1 year ago

krew knows the name of the plugin. Couldn't it automatically copy the kubectl_complete-pluginname file into the PATH if there is one in the plugin package ?

marckhouzam commented 1 year ago

Until this is supported by krew and that plugins make use of it, people can use the following little project to generate the required completion script for about 50% of plugins installed by krew: https://github.com/marckhouzam/kubectl-plugin_completion