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

ct lint fails with chart that has dependencies #87

Closed macmiranda closed 2 years ago

macmiranda commented 2 years ago

Hello,

I'm seeing the issue below when using this action@v2.2.1 to set up the environment and then run ct lint --target-branch main --chart-dirs . . Please keep in mind the root chart depends on a local version of prometheus-postgres-exporter as a subchart

Run ct lint --target-branch main --chart-dirs .
  ct lint --target-branch main --chart-dirs .
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.7.[1](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:1)[3](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:3)/x6[4](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:4)
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.13/x64/lib
    CT_CONFIG_DIR: /opt/hostedtoolcache/ct/v3.[5](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:5).1/x8[6](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:6)_64/etc
    VIRTUAL_ENV: /opt/hostedtoolcache/ct/v3.5.1/x[8](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:8)6_64/venv
Linting charts...
Directory '.github/workflows' is not a valid chart directory. Skipping...

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 common-service => (version: "0.[9](https://github.com/***/helm-charts/runs/6420987744?check_suite_focus=true#step:7:9).1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------

Saving 1 charts
Save error occurred:  directory common-service/charts/prometheus-postgres-exporter not found
Deleting newly downloaded charts, restoring pre-update state
Error: Error linting charts: Error building dependencies for chart 'common-service => (version: "0.9.1", path: "common-service")': Error waiting for process: exit status 1
Error: directory common-service/charts/prometheus-postgres-exporter not found
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
Error linting charts: Error building dependencies for chart 'common-service => (version: "0.9.1", path: "common-service")': Error waiting for process: exit status 1
Error: Process completed with exit code 1.

When I run the same locally, it works fine

Linting charts...
Directory '.github/workflows' is not a valid chart directory. Skipping...

------------------------------------------------------------------------------------------------------------------------
 Charts to be processed:
------------------------------------------------------------------------------------------------------------------------
 common-service => (version: "0.9.1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------

Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "prometheus-community" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Deleting outdated charts
Linting chart 'common-service => (version: "0.9.1", path: "common-service")'
Checking chart 'common-service => (version: "0.9.1", path: "common-service")' for a version bump...
Old chart version: 0.9.0
New chart version: 0.9.1
Chart version ok.
Validating /Users/***/Workspace/helm-charts/common-service/Chart.yaml...
Validation success! 👍
Validating maintainers...
==> Linting common-service
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, 0 chart(s) failed
------------------------------------------------------------------------------------------------------------------------
 ✔︎ common-service => (version: "0.9.1", path: "common-service")
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully

Any ideas? I far as I know ct lint runs helm dep update before linting which should be enough to package the subchart based on the sources.

May be related to #85

macmiranda commented 2 years ago

If anyone runs into the same issue, I resolved it by doing two things: