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
Any krew plugin named like a-b-c today is symlinked as kubectl-a-b-c.
This causes plugin to be invokable only through kubectl a b c and loses the dashes in the original name.
Per kubectl/#540, the new design allows underscores (_) to be treated as - at invocation-time. This means, if a symlink is linked as kubectl-a_b_c, it can be invoked as kubectl a-b-c as desired (and equivalent of pre-1.12 behavior).
Proposed solution
Just replace dashes (-) with underscores _. This way we don't have to replace plugin identifiers in manifest filenames or name: fields.
This way krew can hide this implementation detail behind the covers and not expose it to both plugin devs and plugin users.
Will submit a PR shortly.
The text was updated successfully, but these errors were encountered:
For dashes to be preserved in a plugin's name, its executable name must convert
dashes to underscores.
For example a plugin named "foo-bar" would today be linked as:
kubectl-foo-bar
therefore, it can only be invoked as:
kubectl foo bar
However, linking the same plugin as:
kubectl-foo_bar
allows plugin to be called as:
kubectl foo-bar
kubectl foo_bar
- convert OS detection pluginNameToBin() to explicit input for testability
- test pluginNameToBin().
Fixes#59.
Any krew plugin named like
a-b-c
today is symlinked askubectl-a-b-c
.This causes plugin to be invokable only through
kubectl a b c
and loses the dashes in the original name.Per kubectl/#540, the new design allows underscores (
_
) to be treated as-
at invocation-time. This means, if a symlink is linked askubectl-a_b_c
, it can be invoked askubectl a-b-c
as desired (and equivalent of pre-1.12 behavior).Proposed solution
Just replace dashes (
-
) with underscores_
. This way we don't have to replace plugin identifiers in manifest filenames orname:
fields.This way krew can hide this implementation detail behind the covers and not expose it to both plugin devs and plugin users.
Will submit a PR shortly.
The text was updated successfully, but these errors were encountered: