You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awk: cmd. line:1: warning: regexp escape sequence `"' is not a known regexp operator
Downloading
curl: (3) URL using bad/illegal format or missing URL
Failed to install helm-diff
For support, go to https://github.com/databus23/helm-diff.
Error: plugin install hook for "diff" exited with error
Error: Process completed with exit code 1.
I believe it is that latest commit from #267
Running helm plugin install https://github.com/databus23/helm-diff locally fails.
Whereas helm plugin install https://github.com/databus23/helm-diff --version 97f77494396694beb878128430205888a91d70b4 succeeds (that is the second to last commit)
is returning failure exit code because the latest release (3.1.3) doesn't have architecture specific artifacts (only OS specific) and hence DOWNLOAD_URL is empty after getDownloadURL call
Thanks @mumoshu to ensure I had a clean environment, I ran helm plugin uninstall diff; sudo rm -r ~/Library/Caches/helm/plugins/https-github.com-databus23-helm-diff; helm plugin install https://github.com/databus23/helm-diff and everything installed locally as expected :)
@koenpunt Thanks for reporting! In that case you can just replace 97f77494396694beb878128430205888a91d70b4 with v3.1.3 in the helm plugin install command, as it's really the same for helm-diff.
Specifying 97f77494396694beb878128430205888a91d70b4 results in grabbing plugin.yaml for that commit, which may result in downloading the version of helm-diff that corresponds to the version number embedded in the plugin.yaml, which is 3.1.3 in this case.
In that case you can just replace 97f77494396694beb878128430205888a91d70b4 with v3.1.3
I did that for now, but it should be possible to use a single commit as well? Or at least the script should be able to resolve to a single download url I suppose?
The below log implies that helm is using outdated install-binary.sh of helm-diff (which doesn't have support for new arch-specific archives available since 3.2.0) to install 3.2.0. AFAIK, that cannot happen without a corrupted/outdated plugin cache.
In case it turned out to be outdated plugin cache issue- our install-binary.sh is only backward-compatible(not forward-compatible) so this kind of issue is unavoidable. In other words, if you do want a real solid helm plugin installation step in your CI, I'd say you shouldn't cache ${HELM_CACHE_HOME}/plugins.
@clemensutschig Could you try running git show --oneline --stat in both $HOME/.cache/helm/plugins/https-github.com-databus23-helm-diff and $HOME/.local/share/helm/plugins/helm-diff/ respectively after the helm plugin installation failure to see what's happening?
The error mentioned by @clemensutschig happens with Helm 3.4.2. Updating Helm to 3.5.3 and helm-diff to 3.2.0 fixes the problem. I am not sure what change in Helm 3.5.3 is responsible for this, but I think we can update to 3.5.3.
However, the install displays that it doesn't install version 3.2.0, but rather 3.3.1. I investigated this as it simply seems to install the latest version, no matter what is passed via --version v<VERSION>. I realised that the install script is actually broken until #307. The issue was the following line:
: ${HELM_PLUGIN_DIR:="$("${HELM_BIN}" home --debug=false)/plugins/helm-diff"}
home is not a valid Helm command (neither in the 3.5.x line nor in the latest 3.7.2). Because the script does not exit on error, it continues, but with HELM_PLUGIN_DIR being /plugins/helm-diff. Because that path doesn't exist, version=$(git -C "$HELM_PLUGIN_DIR" describe --tags --exact-match 2>/dev/null || :) returns nothing, which leads to the latest version being downloaded.
Activity
michaeljguarino commentedon Jan 5, 2022
I'm seeing this as well
rkeidar commentedon Jan 5, 2022
It works fine when you run it with specific version:
helm plugin install https://github.com/databus23/helm-diff --version 3.1.3
damienpontifex commentedon Jan 5, 2022
I believe it is that latest commit from #267
Running
helm plugin install https://github.com/databus23/helm-difflocally fails.Whereas
helm plugin install https://github.com/databus23/helm-diff --version 97f77494396694beb878128430205888a91d70b4succeeds (that is the second to last commit)damienpontifex commentedon Jan 5, 2022
I think the
grep $ARCHfromhelm-diff/install-binary.sh
Lines 80 to 84 in 4790fb1
DOWNLOAD_URLis empty aftergetDownloadURLcallpinning helm diff version, workaround for databus23/helm-diff#322
jBouyoud commentedon Jan 5, 2022
Seems need a new release
pin helm-diff version to work around broken master
mumoshu commentedon Jan 5, 2022
Just added arch-specific archives to the existing v3.1.3 release. I hope those fix the issue https://github.com/databus23/helm-diff/releases/tag/v3.1.3
damienpontifex commentedon Jan 6, 2022
Thanks @mumoshu to ensure I had a clean environment, I ran
helm plugin uninstall diff; sudo rm -r ~/Library/Caches/helm/plugins/https-github.com-databus23-helm-diff; helm plugin install https://github.com/databus23/helm-diffand everything installed locally as expected :)mumoshu commentedon Jan 6, 2022
@damienpontifex Glad to hear it worked! Thanks a lot for your confirmation☺️
pinning helm diff version, workaround for databus23/helm-diff#322 (#4)
koenpunt commentedon Jan 7, 2022
This now causes new issues when using a commit hash as version, where it has a download url consisting of multiple urls;
mumoshu commentedon Jan 7, 2022
@koenpunt Thanks for reporting! In that case you can just replace
97f77494396694beb878128430205888a91d70b4withv3.1.3in the helm plugin install command, as it's really the same for helm-diff.Specifying
97f77494396694beb878128430205888a91d70b4results in grabbingplugin.yamlfor that commit, which may result in downloading the version of helm-diff that corresponds to the version number embedded in theplugin.yaml, which is3.1.3in this case.helm-diff/plugin.yaml
Line 4 in 97f7749
koenpunt commentedon Jan 7, 2022
I did that for now, but it should be possible to use a single commit as well? Or at least the script should be able to resolve to a single download url I suppose?
stitakis commentedon Jan 7, 2022
@mumoshu the installation is failing for us.... we are installing in a docker container based on
openshift/jenkins-slave-base-centos7this is the run command:
these are the logs:
14 remaining items
mumoshu commentedon Jan 9, 2022
The below log implies that
helmis using outdatedinstall-binary.shof helm-diff (which doesn't have support for new arch-specific archives available since 3.2.0) to install 3.2.0. AFAIK, that cannot happen without a corrupted/outdated plugin cache.See
HELM_CACHE_HOMEvalue in thehelm envoutput. If you're configuring your CI system to cache that path, it can break like that.mumoshu commentedon Jan 9, 2022
In case it turned out to be outdated plugin cache issue- our
install-binary.shis only backward-compatible(not forward-compatible) so this kind of issue is unavoidable. In other words, if you do want a real solid helm plugin installation step in your CI, I'd say you shouldn't cache${HELM_CACHE_HOME}/plugins.clemensutschig commentedon Jan 9, 2022
ok deleting with
rm -rf $HOME/.cache/helm/plugins/https-github.com-databus23-helm-diff || truedoes not help ... :(from helm env
mumoshu commentedon Jan 9, 2022
@clemensutschig Could you try running
git show --oneline --statin both$HOME/.cache/helm/plugins/https-github.com-databus23-helm-diffand$HOME/.local/share/helm/plugins/helm-diff/respectively after the helm plugin installation failure to see what's happening?mumoshu commentedon Jan 9, 2022
I'm currently using Helm 3.5.3 so try upgrading helm if that makes difference.
mumoshu commentedon Jan 9, 2022
Please see the relevant part of install-binary.sh across versions below:
--version 3.1.3helm-diff/install-binary.sh
Lines 72 to 83 in b80187e
installs 3.1.3 by
grep $OS | grep $ARCH+ https://github.com/databus23/helm-diff/releases/tag/v3.1.3--version 3.2.0helm-diff/install-binary.sh
Lines 72 to 83 in 860f354
installs 3.2.0 by
grep $OS | grep $ARCH+ https://github.com/databus23/helm-diff/releases/tag/v3.2.0without
--versionIt will use the script at the HEAD of the master branch
helm-diff/install-binary.sh
Lines 85 to 89 in 7486472
installs 3.2.0 today thanks to L89
michaelsauter commentedon Jan 10, 2022
So I did some more debugging around this.
The error mentioned by @clemensutschig happens with Helm 3.4.2. Updating Helm to 3.5.3 and helm-diff to 3.2.0 fixes the problem. I am not sure what change in Helm 3.5.3 is responsible for this, but I think we can update to 3.5.3.
However, the install displays that it doesn't install version 3.2.0, but rather 3.3.1. I investigated this as it simply seems to install the latest version, no matter what is passed via
--version v<VERSION>. I realised that the install script is actually broken until #307. The issue was the following line:homeis not a valid Helm command (neither in the 3.5.x line nor in the latest 3.7.2). Because the script does not exit on error, it continues, but withHELM_PLUGIN_DIRbeing/plugins/helm-diff. Because that path doesn't exist,version=$(git -C "$HELM_PLUGIN_DIR" describe --tags --exact-match 2>/dev/null || :)returns nothing, which leads to the latest version being downloaded.The latest version of
helm-diff, 3.3.1, works correctly, however only in systems which supportwhich, which is not POSIX compatible (see e.g. https://stackoverflow.com/questions/592620/how-can-i-check-if-a-program-exists-from-a-bash-script) and consequently fails on UBI images for example.I'm going to provide a fix for this in a sec.
mumoshu commentedon Jan 10, 2022
😱
Merge pull request #339 from michaelsauter/fix/install-script
mumoshu commentedon Jan 10, 2022
3.3.2 has been released with the fix. Would you mind trying once again?
michaelsauter commentedon Jan 10, 2022
@mumoshu It works now, thank you very much!
mumoshu commentedon Jan 10, 2022
@michaelsauter Thank you for your help!
Hammond95 commentedon Jan 12, 2022
@michaelsauter Thank you for spotting that, I am the one who has included the line using which, I didn't thought about the POSIX compatibility.
On the other hand the home command was already in the script, and I kept it for back compatibility with helm2.
Not sure it would still work for helm2 without that line.
mumoshu commentedon Jan 22, 2022
@rkeidar I hope it's already fixed for you too and you're having happy days.
Closing as resolved.
Thank you everyone for your support!
P.S. I'm willing to add Alpine Linux and Busybox to our test matrix (#347). Your contribution is much appreciated!