chart-testing icon indicating copy to clipboard operation
chart-testing copied to clipboard

'Directory is not a valid chart directory'

Open alex-hempel opened this issue 5 years ago • 4 comments

Is this a request for help?: Yes

Version of Helm and Kubernetes:

ct version v3.0.0-rc.1 (Docker image)

What happened: I am trying to run ct lint against my local copy of the git repo, comparing against the charts hosted in my private helm repo.

Using the Docker image, I run the following command line:

docker run -v pwd:/pwd-wpwdquay.io/helmpack/chart-testing:latest ct lint --chart-dirspwd --chart-repos <repo-name>=https://<repo-url> --helm-repo-extra-args "<repo-name>=--username <user> --password <password>"

I have changes in my local copy that aren't on the remote. For each changed chart, the output is 'Directory '' is not a valid chart directory. Skipping...`

What you expected to happen: Either to see linting output, or to get told why the directory is not considered valid.

What can I look at to understand why ct lint thinks the chart directory is not valid?

alex-hempel avatar Apr 08 '20 05:04 alex-hempel

This can happen when the lint configuration YAML is in the same directory as your charts.

bonifaido avatar Sep 18 '20 07:09 bonifaido

Hello @alex-hempel have you managed to resolve the issue?

shreben avatar Jan 11 '22 09:01 shreben

having the same issue. CT v3.5.1 and lint file is not in the same dir as my chart.

jdomag avatar Apr 01 '22 12:04 jdomag

Same issues with 3.7.0 running on the linkerd-viz chart with the default values. I'm not using a lint configuration YAML.

$ ct lint --chart-dirs helm-charts/linkerd/linkerd-viz --target-branch main
Linting charts...
Directory 'helm-charts/linkerd/linkerd-viz' is not a valid chart directory. Skipping...
------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully

Looking at https://github.com/helm/chart-testing/blob/ba5aed29ec88e9fc187915f115890cb174999a3c/pkg/util/util.go#L136 it seems that the chart needs to be in a direct subdir of the configured chart-dirs:

ct lint --chart-dirs helm-charts/linkerd/linkerd-viz # does not work
ct lint --chart-dirs helm-charts/linkerd/ # works
ct lint --chart-dirs helm-charts/ # does not work

For me the solution was to pass in multiple chart dirs with ct lint --chart-dirs helm-charts,helm-charts/linkerd/

Anyway, it would be great if chart-testing can show a detailed error message in this case

arthurk avatar Aug 25 '22 02:08 arthurk

I was experiencing the same problem. I solved by moving my chart to a directory called chart.

./chart/my-chart/

brunopadz avatar May 30 '23 14:05 brunopadz

Really there is no solution for it? I'm facing the same as chart is in deployment/kubernetes

dsever avatar Nov 22 '23 13:11 dsever

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 23 '23 01:12 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Dec 28 '23 01:12 github-actions[bot]