helm-git icon indicating copy to clipboard operation
helm-git copied to clipboard

Bug: helm-git doesn't work with packaged helm charts

Open almed4 opened this issue 4 years ago • 0 comments

When adding a helm repo from a private git repo using helm-git, the repo can only be successfully added with a ref to the charts' source directory, not the packaged charts in a directory with a helm repo index file.

helm-git version: v0.10.0

Steps To Reproduce

  1. Create private git repo
  2. Add charts to a charts directory
  3. Package charts to a repo directory
  4. Index packaged charts with helm repo index
  5. Add repo with helm-git
helm repo add --username *** --password *** git+https://github.com/owner/repository@packaged-charts?ref=branch

The current behavior

$ noglob helm repo add --username $HELM_USER --password $HELM_TOKEN repo-name git+https://github.com/owner/repository@packaged-charts?ref=branch&sparse=1
[1] 58353
$ Debug in plugin 'helm-git': repo: https://github.com/owner/repository ref: branch path: packaged-charts file: index.yaml sparse: 1 depupdate: 1
Debug in plugin 'helm-git': helm_repo_uri: git+https://github.com/owner/repository@packaged-charts?ref=branch&sparse=1&depupdate=1
Error: Chart.yaml file is missing
Error: looks like "git+https://github.com/owner/repository@packaged-charts?ref=branch" is not a valid chart repository or cannot be reached: plugin "helm-git" exited with error

[1]  + exit 1     noglob helm repo add --username $HELM_USER --password $HELM_TOKEN  

The expected behavior

$ noglob helm repo add --username $HELM_USER --password $HELM_TOKEN repo-name git+https://github.com/owner/repository@packaged-charts?ref=branch&sparse=1
[1] 58353
$ Debug in plugin 'helm-git': repo: https://github.com/owner/repository ref: branch path: packaged-charts file: index.yaml sparse: 1 depupdate: 1
Debug in plugin 'helm-git': helm_repo_uri: git+https://github.com/owner/repository@packaged-charts?ref=branch&sparse=1&depupdate=1
"repo-name" has been added to your repositories

[1]  + done       noglob helm repo add --username $HELM_USER --password $HELM_TOKEN  

almed4 avatar Jun 29 '21 15:06 almed4