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

[BUG REPORT] Any Change to Chart Returns "is not a valid chart directory. Skipping..."

Open gvanriper opened this issue 5 years ago • 5 comments

Version of Helm and Kubernetes: helm verison: 3.4.1 kubectl version: 1.19.3 ct version: 3.3.1

I'm following a book (Packt - Learn Helm) and I hit a stopping point when trying to make any change to verify changes done within charts.

I'm expecting it to advise no changes and then when I make a change to the description of the chart, to then return that a change has been made to the chart.

I am instead getting the "is not a valid chart directory. Skipping..."

Here are my exact steps to recreate:

  • git clone https://github.com/PacktPublishing/-Learn-Helm Learn-Helm
  • cd to project
  • ct lint-and-install
  • ct lint-and-install returns with "No chart changes detected."
  • git checkout -b chart-testing-example to create a separate branch for changes.
  • cd to /helm-charts/charts/guestbook
  • change chart description from "A Helm chart for Kubernetes" to "Used to deploy the Guestbook application" and save
  • ct lint-and-install returns "Directory 'helm-charts\charts\guestbook' is not a valid chart directory. Skipping..." and "No chart changes detected."

If you then ctrl+z back to original file and save, it will then work and advise "No chart changes detected." I thought maybe it's the format it's saving as. I am saving as UTF-8 and carriage return as CRLF.

NOTE: I am running Windows 10. I have tried from notepad, notepad++, and Visual Code. All return the same results.

ALSO NOTE: I am a total newbie at Helm charts and just trying to learn. It may be something simple that I am missing that the book was unclear of.

I appreciate any assistance.

gvanriper avatar Jan 05 '21 14:01 gvanriper

ct by default looks for a charts/ subdirectory containing all your charts.

try running it from the helm-charts/ directory.

smlx avatar Jan 06 '21 00:01 smlx

@smlx , thanks for the response. I did move to charts/ and tried the same and it did not work. Please note that I have a ct.yaml in the root that has the following values:

**chart-dirs:

  • helm-charts/charts

chart-repos:

  • bitnami=https://charts.bitnami.com/bitnami

validate-maintainers: false**

I am finding that if I match the chart to the one in the Git repo, it works even if I modified it back to it's original values. Any change that is different than the chart in the Git repo then returns not a valid chart.

gvanriper avatar Jan 06 '21 14:01 gvanriper

i digged into same problem. on windows git bash result is

$ ct list-changed
...
Directory 'charts\rocketchat' is not a valid chart directory. Skipping...
...

on wsl2 (ubuntu in windows) result is

$ ct list-changed
charts/rocketchat

i am not able to fix code in go but i looked around code an at https://github.com/helm/chart-testing/blob/e84e88cf8bd04ac91000fd675d4cfc2ddf69ba96/pkg/chart/chart.go#L720

there is a fix / for path seperator. this has to be os-specific (\ on windows) i think

i also find other points with '/' what is not working in windows environemt.

tgruenert avatar Feb 19 '21 19:02 tgruenert

Hey all, it's officially been over a year. Is there any update to resolving this issue on Windows machines?

gvanriper avatar Jan 14 '22 17:01 gvanriper

Is it only Windows related? I'm on Fedora and gets the same error. Wired thing is that below command works fine

ct lint --lint-conf lintconf.yaml --config ct.yaml --chart-yaml-schema chart_schema.yaml --chart-dirs .  --charts .

but when I remove --charts argument, it throws is not a valid chart directory. Skipping... I'm testing with ct 3.5.1

jdomag avatar Apr 29 '22 13:04 jdomag

still an issue

geronimomark avatar Oct 24 '23 02:10 geronimomark

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 Nov 24 '23 01:11 github-actions[bot]

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

github-actions[bot] avatar Nov 29 '23 01:11 github-actions[bot]

Can we get this reopened if it's not resolved? I feel like this is an important issue to handle for different OS's.

gvanriper avatar Dec 15 '23 16:12 gvanriper

any update on this?

cometta avatar Mar 15 '24 08:03 cometta