helm-gh-pages
helm-gh-pages copied to clipboard
Fail to publish charts with dependencies stored on the same repository (when private)
Hello,
I use helm-gh-pages to store my Helm charts in a private Github repository. I discovered that when one tries to publish a chart that depends on a subchart present on the same private repository, the action fails with a 404 error.
In particular, I've developed chartB
and published it successfully via helm-gh-pages on my private repo.
I've also developed an umbrella chart (called chartA
) that depends on chartB
. During publishing of chartA
, helm-gh-pages fails with the following error:
Found chart directory charts/chartB
Found chart directory charts/chartA
Getting updates for unmanaged Helm repositories...
Error: no cached repository for helm-manager-zzzzzzzzzzzzzzzzzzzzzz found. (try 'helm repo update'): open /github/home/.cache/helm/repository/helm-manager-zzzzzzzzzzzzzzzzzzzzzz-index.yaml: no such file or directory
...Unable to get an update from the "https://raw.githubusercontent.com/my/helm-charts-repository/gh-pages" chart repository:
failed to fetch https://raw.githubusercontent.com/my/helm-charts-repository/gh-pages : 404 Not Found
(URLs have been anonymised)
The root-cause of this is that helm doesn't have the Github private repository configured using helm repo add
.
A workaround is adding the repo prior to fetching dependencies. For example.
helm repo add ${REPOSITORY} ${CHARTS_URL} --username ${GITHUB_TOKEN} --password ${GITHUB_TOKEN}
Thus, any charts that exist on the Github private repository would be accessible, if used by another chart. I understand that this functionality isn't always desirable. But it can easily toggled-on, when needed.