datreeio / helm-datree

A Helm plugin to validate charts against the Datree's CLI tool
https://hub.datree.io/integrations
MIT License
113 stars 26 forks source link

helm datree test my-app/ doesn't work on Windows WSL #51

Closed proxyvert closed 1 year ago

proxyvert commented 1 year ago

Describe the bug command 'helm datree test my-test-app/' gives the following error: Error: unknown flag: --skip-tests Error: plugin "datree" exited with error

To Reproduce Steps to reproduce the behavior:

  1. Run command 'helm create my-test-app'
  2. Run command 'helm datree test my-test-app/'
  3. See error:
    Error: unknown flag: --skip-tests Error: plugin "datree" exited with error

Expected behavior Output similar to datree test my-test-app.yaml (helm template my-test-app/ > my-test-app.yaml; datree test my-test-app.yaml)

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Datree plugin version (run helm datree verion):

Additional context
Add any other context about the problem here.

eyarz commented 1 year ago

@PaleIntrovert can you please try to pass a dir name without the dashes (-) and let us know if this is working? (e.g myTestApp/) I suspect it is a bug related to the plunging parsing the CLI params.

proxyvert commented 1 year ago

@eyarz it definetely helped, but there is another bug it didn't work with 'test_app/' but worked with 'test_app/*' image

hadar-co commented 1 year ago

Hi @PaleIntrovert , I'm trying to reproduce this but no success so far, even when using a chart name like my-test-app with dashes. I'm running helm version 3.11.1 (I see you're running v3.2.0). I found some references saying that the --skip-tests flag that we use is supported in Helm version 3.5 and higher. Can you try to update helm and run again?

proxyvert commented 1 year ago

Hi @hadar-co, I installed helm version 3.11.1, looks like the problem is gone. I have one question, It says there is no internet connection, so it cannot check schema validation. How can I make it work, I have envs http_proxy, https_proxy, no_proxy configured. image

hadar-co commented 1 year ago

@PaleIntrovert Glad to see that it fixed your issue 👍 Regarding the internet connection - since I do not know your environment, I can't say for sure what the issue is. The schema validation step fetches the schemas from Github, so let's try that - try to curl a schema directly from your env and see if it works: curl https://github.com/yannh/kubernetes-json-schema/blob/master/v1.22.7-standalone/deployment-apps-v1.json

proxyvert commented 1 year ago

@hadar-co I tried curl command, and it works, so it means my proxy envs are working, why helm datree plugin doesn't respect them? Should I add something to helm config?

hadar-co commented 1 year ago

Datree uses Kubeconform to perform schema validation. In their docs they show how to use an https proxy. To understand if this is an issue on our side or theirs, please run kubeconform using the proxy as shown in the link and let us know if it works. If it does, then we have a bug and we will fix it. We will keep this open until we get your result. Thanks

proxyvert commented 1 year ago

@hadar-co it seems our corporate proxy hijacks certs, and it is my issue, not kubeconfig's or datree's. image I will install proxy's certificate inside WSL, and will update on my results with proposed command.

hadar-co commented 1 year ago

@PaleIntrovert Thanks for the update:)

proxyvert commented 1 year ago

@hadar-co here are results: image