chartmuseum / helm-push

Helm plugin to push chart package to ChartMuseum
Apache License 2.0
670 stars 170 forks source link

Installation from release binary is not working #161

Closed mparada closed 2 years ago

mparada commented 2 years ago

Description

If I try downloading a release binary and installing it I get the following error: sh: scripts/install_plugin.sh: No such file or directory

To reproduce

  1. Download a binary, e.g.: wget https://github.com/chartmuseum/helm-push/releases/download/v0.9.0/helm-push_0.9.0_linux_amd64.tar.gz
  2. Open the tar file to a specific folder:
    mkdir -p helm-push  # any folder name to untar the file
    tar -xzf helm-push_0.9.0_linux_amd64.tar.gz -C helm-push
  3. Install plugin: helm plugin install helm-push # here the folder name is used again

Environment

Notes

The plugin itself appears in helm plugin list and seem (so far) to be working. It is just the installation that throws an error. I'm not sure this is reproducible though. I tried uninstalling it and re-installing it and it is always is the same but I also once installed from github directly (helm plugin install https://github.com/chartmuseum/helm-push) and maybe some configuration file was left behind 🤷‍♂️

Ideas

It tries to look into the scripts folder but this is not part of the release tar file. Also, the scripts/install_plugin.sh file tries to fetch data from github (lines 55 and 57). My guess is that lines 54-59 in install_plugin.sh is not necessary if installing directly from the binary. Maybe wrap that code in a conditional clause that checks if the binary is already downloaded? Or an alternate scripts/install_plugin_local.sh file (without those lines) that is also packaged in the release tar file and mentioned accordingly in plugin.yaml?

mparada commented 2 years ago

Sorry... Only now I saw there are 2 PRs related to this issue:

Should I close this issue? Any idea when one of the PR will be merged?

mparada commented 2 years ago

I found a solution. Apparently the helm plugin install is not actually needed. Simply unpack the release binary into a folder in the helm env HELM_PLUGINS location.

mkdir -p "$(helm env HELM_PLUGINS)/helm-push"
tar -C "$(helm env HELM_PLUGINS)/helm-push" -xzf <dowloaded release binary>

That installs it correctly without any error. You can check with helm plugin list.

I'm going to close the issue. If the maintainers agree with this solution I would advise to put it somewhere in the docs. Maybe in the README in the Install section.