Open sttts opened 1 month ago
TIL kubectl create [...]
now allows plugins as of v1.30. I think we should have a spec
field in the Plugin manifest to facilitate this. Open questions:
kubectl create
? what if kubectl changes its mind to allow more builtin commands to support plugins, too?Do we only skip the first dash, or do we preserve all dashes
For example should a Plugin with name: create-x-y-z
be linked as kubectl-create-x_y_z
or kubectl-create-x-y-z
? The latter technically allows invocations like:
kubectl create x-y-z
kubectl create x y z
kubectl create x-y z
(Krew intentionally only supports the first form, i.e. plugin is registered only with its metadata.name
, as-is).
/kind feature /priority important-soon
Wile looking into shipping a
kubectl create something
plugin via krew I noticed that the- => _
rewriting in https://github.com/kubernetes-sigs/krew/blob/48b3ea15a8f640bbfca550782a9ccf9051f13731/internal/installation/install.go#L242 makes this impossible right now.Background: kubectl allows these create plugins (and only those) since https://github.com/kubernetes/kubernetes/pull/124123.
Basically we have this situation:
$ kubectl create-something
maps to the binarykubectl-create_something
$ kubectl create something
maps to the binarykubectl-create-something
create-something
plugin into thekubectl-create_something
binary on disk (even though the binary in the plugin tar is properly named.How could we allow to ship a
kubectl-create-something
binary?xref https://kubernetes.slack.com/archives/CTJNMDM24/p1728488438493869