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

docs: Update shell autocompletion instructions #3377

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

jopit
Copy link
Contributor

@jopit jopit commented Feb 16, 2024

The docs currently describe how to enable shell auto completion for the rollouts CLI when run as a standalone binary, but the don't describe how to get auto completion to work when used from kubectl.

This PR updates the docs with instructions on how this can be done, based on the information here: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/2379-kubectl-plugins#shell-completion-support

This works with kubectl version 1.26 and newer.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Signed-off-by: John Pitman <jpitman@redhat.com>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

Go Published Test Results

2 130 tests   2 130 ✅  2m 50s ⏱️
  118 suites      0 💤
    1 files        0 ❌

Results for commit ca248ed.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8405f2e) 81.83% compared to head (ca248ed) 83.00%.
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3377      +/-   ##
==========================================
+ Coverage   81.83%   83.00%   +1.16%     
==========================================
  Files         135      135              
  Lines       20688    16873    -3815     
==========================================
- Hits        16931    14005    -2926     
+ Misses       2883     1996     -887     
+ Partials      874      872       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

E2E Tests Published Test Results

  4 files    4 suites   3h 44m 32s ⏱️
107 tests  95 ✅  6 💤  6 ❌
442 runs  404 ✅ 24 💤 14 ❌

For more details on these failures, see this check.

Results for commit ca248ed.

@zachaller zachaller merged commit 50b2885 into argoproj:master Feb 16, 2024
21 checks passed
@kzap
Copy link
Contributor

kzap commented Feb 29, 2024

@jopit how does this work just by putting a file in /usr/local/bin/ ? Is that a known path or must one also setup kubectl argo rollouts completion bash ?

@jopit
Copy link
Contributor Author

jopit commented Feb 29, 2024

@kzap to provide completion for a plugin when run by kubectl, the kubectl command will search the PATH for an executable file using the prefix kubectl_complete- followed by the plugin name. That executable must determine what the appropriate completions are and write them to stdout. More details can be found here: https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/2379-kubectl-plugins#shell-completion-support

There is no need to setupkubectl argo rollouts completion bash -- that provides completions when the plugin executable is run standalone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants