Search code examples
kuberneteskubernetes-helm

Why does Helm push with "--dependency-update" not find the repository by name but "helm dependency update" does?


I have a Chart.yaml with the following:

Chart.yaml

dependencies:
  - name: my-app
    version: "0.1.0"
    repository: "@my-chartmuseum-repo"

And I added the repo to helm:

# helm repo list
NAME                    URL
my-chartmuseum-repo     http://127.0.0.1:8080/
stable                  https://charts.helm.sh/stable

When I run helm dependency update my-owning-app I get the successful message:

helm dependency update my-owning-app
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "my-chartmuseum-repo" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading my-app from repo http://127.0.0.1:8080/
Deleting outdated charts

However, when I try to do this via helm push my-owning-app/ my-chartmuseum-repo --dependency-update I get the error:

Error: no repository definition for @my-chartmuseum-repo. Please add them via 'helm repo add'
Usage:
  helm push [flags]

Flags:
# ...elided...

Why would it work in the first command but not the second one to find the repository by name?


Solution

  • This is a community wiki answer. Feel free to expand on it.

    The --dependency-update flag for the helm push plugin is currently not working properly due to the fact that it does not omit the @ symbol when checking the name of the repository.

    As a workaround, you could use the Helm Dependency Update with a --repository-config string flag:

    path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")