Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ct lint fails with chart that has dependencies #87

Closed
macmiranda opened this issue May 13, 2022 · 1 comment
Closed

ct lint fails with chart that has dependencies #87

macmiranda opened this issue May 13, 2022 · 1 comment

Comments

@macmiranda
Copy link

Hello,

I'm seeing the issue below when using this [email protected] 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
Copy link
Author

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

  • Making sure that the fetch-depth of the action/checkout@v2 is set to "0"
  • Removing the repository attribute from the charts' dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant