chartmuseum / helm-push

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

fix: support multi-arch #129

Closed volker-raschek closed 2 years ago

volker-raschek commented 2 years ago

Adapt install_plugin.sh to download the correct binary. Otherwise the binary for amd64 systems will be downloaded on systems with a different target architecture and the execution of helm cm-push throws an exec format error.

If the release can not be found for the target architecture, the install script throws an error.

Please check if ci works correctly with this patch. I am not so familiar with github actions.

volker-raschek commented 2 years ago

Hi @jdolitsky, I revert my changes in Makefile. Should I also add the missing targets in .goreleaser how it is documented? For example:

...
    goarch:
      - amd64
      - arm
      - arm64
    goarm:
      - 6
      - 7
jdolitsky commented 2 years ago

@volker-raschek yes. that sounds good. we can try out a release once your changes are in

volker-raschek commented 2 years ago

Hi @jdolitsky, I added the lines of code in .goreleaser.

jdolitsky commented 2 years ago

@volker-raschek want to try out the new release and see if your script works?

volker-raschek commented 2 years ago

Hi @jdolitsky, helm pulls the old version of the plugin. Maybe we must increase the version of the plugin in plugin.yaml?

$ docker run --rm -it volkerraschek/helm:3.8.0-arm64-v8 plugin install https://github.com/chartmuseum/helm-push.git
Downloading and installing helm-push v0.10.1 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.10.1/helm-push_0.10.1_linux_arm64.tar.gz
Error: plugin install hook for "cm-push" exited with error
jdolitsky commented 2 years ago

@volker-raschek ah yea. please try now

volker-raschek commented 2 years ago

@jdolitsky,

now it works. Thanks a lot!

$ docker run --rm -it --entrypoint sh volkerraschek/helm:3.8.0-arm64-v8 
/ # helm plugin install https://github.com/chartmuseum/helm-push.git
Downloading and installing helm-push v0.10.2 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.10.2/helm-push_0.10.2_linux_arm64.tar.gz
Installed plugin: cm-push
/ # helm cm-push -h
Helm plugin to push chart package to ChartMuseum

Examples:

  $ helm cm-push mychart-0.1.0.tgz chartmuseum       # push .tgz from "helm package"
  $ helm cm-push . chartmuseum                       # package and push chart directory
  $ helm cm-push . --version="1.2.3" chartmuseum     # override version in Chart.yaml
  $ helm cm-push . https://my.chart.repo.com         # push directly to chart repo URL

Usage:
  helm cm-push [flags]

Flags:
      --access-token string             Send token in Authorization header [$HELM_REPO_ACCESS_TOKEN]
...