Skip to content

feat(comp): Dynamic completion of charts - #6706

Closed
marckhouzam wants to merge 1 commit into
helm:dev-v3from
VilledeMontreal:feat-v3/dynCompChart
Closed

marckhouzam wants to merge 1 commit into
helm:dev-v3from
VilledeMontreal:feat-v3/dynCompChart

Conversation

@marckhouzam

Copy link
Copy Markdown
Member

What this PR does / why we need it:

This PR enables dynamic shell completion for charts. This includes chart references, local charts, and URLs.

  1. Chart references are completed using helm search repo <specified repo> to look for possible choices.
  2. Local charts are completed using shell file completion.
  3. URLs only have their prefix completed (see example).

The following commands are supported:

helm show <subcmd> <TAB>      - completes to chart (ref, path, url)
helm pull <TAB>               - completes to chart (ref, url)

helm install [NAME] <TAB>     - completes to chart (ref, path, url)
helm template [NAME] <TAB>    - completes to chart (ref, path, url)
helm upgrade <TAB>            - completes to release name
helm upgrade <release> <TAB>  - completes to chart (ref, path, url)

Of note is the handling the case where no prefix is specified for completion of charts as shown in the first example below.

Example 1:

> helm install name <TAB>
# provides the choices (based on my configured repos)
./      /     astronomer/   file://     gitlab/     http://    https://     stable/

In the above example:

  1. ./ and / are shown as a hint to the user that charts on the file system can be specified
  2. astronomer/, gitlab/ and stable/ are repos currently configured
  3. file://, http:// and https:// are the URL prefixes a user can use

Example 2:

> helm install name sta<TAB>
# uses helm repo list to complete to:
> helm install name stable/

> helm install name stable/nginx-<TAB>
# uses helm search to complete to:
stable/nginx-ingress         stable/nginx-ldapauth-proxy  stable/nginx-lego

Special notes for your reviewer:

This PR has been tested for backwards compatibility using the acceptance-testing repo.

New tests have been prepared in helm/acceptance-testing#56

helm show <subcmd> <TAB>      - completes to chart (ref, path, url)
helm pull <TAB>               - completes to chart (ref, url)

helm install [NAME] <TAB>     - completes to chart (ref, path, url)
helm template [NAME] <TAB>    - completes to chart (ref, path, url)
helm upgrade <TAB>            - completes to release name
helm upgrade <release> <TAB>  - completes to chart (ref, path, url)

Signed-off-by: Marc Khouzam <[email protected]>
@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 19, 2019
@marckhouzam

Copy link
Copy Markdown
Member Author

Closes #3170

@bacongobbler

Copy link
Copy Markdown
Member

Apologies for the automatic closure. We just switched the dev-v3 branch to master, and the old master branch is now dev-v2. Would you mind re-opening a new PR with this change? Thanks again and sorry for the hassle!

@marckhouzam
marckhouzam deleted the feat-v3/dynCompChart branch October 21, 2019 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants