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

Convert dashes in plugin names to underscores #60

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Sep 26, 2018

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.

@ahmetb
Copy link
Member Author

ahmetb commented Sep 26, 2018

cc: @lbb

@codecov-io
Copy link

codecov-io commented Sep 26, 2018

Codecov Report

Merging #60 into master will increase coverage by 0.68%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   41.49%   42.18%   +0.68%     
==========================================
  Files          12       12              
  Lines         547      550       +3     
==========================================
+ Hits          227      232       +5     
+ Misses        273      272       -1     
+ Partials       47       46       -1
Impacted Files Coverage Δ
pkg/installation/util.go 60% <100%> (ø) ⬆️
pkg/installation/install.go 23.07% <100%> (+5.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c9ca34...51b71cd. Read the comment docs.

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().

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
Copy link
Contributor

@lbb lbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ahmetb ahmetb merged commit 263bfcb into kubernetes-sigs:master Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants