Open ziaenezhad opened 4 years ago
I have no windows system to try this on. Can you enable debugging with export HELM_GIT_DEBUG=1
and post the output?
Thanks
I did, but no more information, just like before:
Error: looks like "git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2" is not a valid chart repository or cannot be reached: exec: "C:\\Users\\Sajjad\\AppData\\Roaming\\helm\\plugins\\helm-git\\helm-git": file does not exist
I worked a bit more on it.
The error was because we can't directly execute shell scripts on windows. so I made a new file helm-git.bat
and set the command
attribute within plugin.yaml
to trigger this one, instead of the default to wrap the shell script:
sh ./helm-git %0 "%2" "%3" %4
now I'm getting this:
$ helm repo add cert-manager git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2
write /dev/stdout: The pipe is being closed.
Error: looks like "git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2" is not a valid chart repository
or cannot be reached: error converting YAML to JSON: yaml: line 5: mapping values are not allowed in this context
any idea?
Thanks for taking time to work on this. Is debugging enabled?
nope, it's with the debugging:
helm repo add cert-manager git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2
write /dev/stdout: The pipe is being closed.
Warning in plugin 'helm-git': git_ref is empty, defaulted to 'master'. Prefer to pin GIT ref in URI.
Debug in plugin 'helm-git': repo: https://github.com/jetstack/cert-manager ref: master path: deploy/charts file: index.yaml sparse: 1 depupdate: 1
Debug in plugin 'helm-git': helm_repo_uri: git+https://github.com/jetstack/cert-manager@deploy/charts?ref=master&sparse=1&depupdate=1
Error: looks like "git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 5: mapping values are not allowed in this context
Can you try with the following build (with debug enabled): #133 I added some logs to try to nail the issue
yes:
$ helm repo add cert-manager git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2
write /dev/stdout: The pipe is being closed.
Warning in plugin 'helm-git': git_ref is empty, defaulted to 'master'. Prefer to pin GIT ref in URI.
Debug in plugin 'helm-git': repo: https://github.com/jetstack/cert-manager ref: master path: deploy/charts file: index.yaml sparse: 1 depupdate: 1
Debug in plugin 'helm-git': helm_repo_uri: git+https://github.com/jetstack/cert-manager@deploy/charts?ref=master&sparse=1&depupdate=1
Debug in plugin 'helm-git': helm index produced at /tmp/helm-git.Lp6Iqi/index.yaml: apiVersion: v1
entries:
cert-manager:
- apiVersion: v1
appVersion: v0.1.0
created: "2020-11-18T08:13:45.3239102+03:30"
description: A Helm chart for cert-manager
digest: cfbf6057fbc395ea243f747221c749515cc78324da3bc624bcd6aee074d7855b
home: https://github.com/jetstack/cert-manager
icon: https://raw.githubusercontent.com/jetstack/cert-manager/master/logo/logo.png
keywords:
- cert-manager
- kube-lego
- letsencrypt
- tls
maintainers:
- email: james@jetstack.io
name: munnerz
name: cert-manager
sources:
- https://github.com/jetstack/cert-manager
urls:
- git+https://github.com/jetstack/cert-manager@deploy/charts/cert-manager-v0.1.0.tgz?ref=master&sparse=1&depupdate=1
version: v0.1.0
generated: "2020-11-18T08:13:45.3209792+03:30"
Error: looks like "git+https://github.com/jetstack/cert-manager@deploy/charts?ref=v0.6.2" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 5: mapping values are not allowed in this context
Also, I'm getting these params in my bat file, if helps:
echo "%0 %1 %2 %3 %4 %5"
"C:\Users\Sajjad\AppData\Roaming\helm\plugins\helm-git\helm-git.bat "" "" "" git+https://github.com/jetstack/cert-manager@deploy/charts/index.yaml?ref v0.6.2 "
I think you may need to quote the %4
in your bat file.
@sajjad-shirazy Any updates?
@aslafy-z While I would absolutely love to have this plugin working on Windows, I definitely sympathize with the difficulty of getting shell scripts running on Windows.
If you don't mind some unsolicited advice on a different direction you could look at for a short-term workaround...
Keep in mind this is just an idea, I would need to test it a bit with a local copy of your plugin:
Make a Windows-compatible version by
The nice thing about busybox is that it is smart enough to back out to Windows when it cannot find an executable, so git, for example, would call the Windows git executable.
It's not a long-term solution. For that, I would recommend making a powershell version of your helm-git-plugin.sh. Powershell comes with Windows anyway and it is easier to convert from sh to Powershell than it is from sh to BAT. Then you could rework the root helm-git script with the same framework as above, but the BAT section would then call Powershell instead of busybox.
helm-git doesn't work on my Windows 10
helm-git
version: 0.8.1Steps To Reproduce
Shows this error: