helm / chart-testing-action

A GitHub Action to lint and test Helm charts
https://github.com/helm/chart-testing
Apache License 2.0
245 stars 71 forks source link

dependency chart requires adding repo definition first #85

Open fty4 opened 2 years ago

fty4 commented 2 years ago

Hello everyone,

I just tested this action and find it very useful.

When using the ct install inside a workflow I have a problem with the dependencies. The chart that will be installed depends on another chart and Helm expects the repository already be present.

Here is the message from the run:

Error message ```bash Installing charts... Version increment checking disabled. ------------------------------------------------------------------------------------------------------------------------ Charts to be processed: ------------------------------------------------------------------------------------------------------------------------ mychart => (version: "0.2.3", path: "./") ------------------------------------------------------------------------------------------------------------------------ Error: no repository definition for [https://chart.url/.](https://chart.url/) Please add the missing repos via 'helm repo add' Error: Error installing charts: Error building dependencies for chart 'mychart => (version: "0.2.3", path: "./")': Error waiting for process: exit status 1 ------------------------------------------------------------------------------------------------------------------------ No chart changes detected. ------------------------------------------------------------------------------------------------------------------------ Error installing charts: Error building dependencies for chart 'mychart => (version: "0.2.3", path: "./")': Error waiting for process: exit status 1 Error: Process completed with exit code 1. ```

In my local dev environment this repo to the chart is already added - but inside the runner not. Is there any best practice how the charts can be added automatically (by ct?)?

Currently my approach would be to read out all dependencies.*.repository values from the Chart.yaml and add them in an extra step via bash.

cpanato commented 1 year ago

if the dependent chart is public and has a release for that you can just add it in the config.

like

chart-repos:
  - ingress-nginx=https://kubernetes.github.io/ingress-nginx
  - sigstore=https://sigstore.github.io/helm-charts