Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CY-5242] [Bug]install-binary.sh returning 2 URLs for OS=linux breaking 'helm plugin install' on linux #50

Open
johnphilipscs opened this issue Nov 16, 2021 · 9 comments
Labels
jira-issue Issue tracked on JIRA

Comments

@johnphilipscs
Copy link

When this line is executed with OS=linux, a string containing 2 URLs are returned and then the download curl fails due to malformed URL:

DOWNLOAD_URL=$(curl -s $latest_url | grep $OS | awk '/"browser_download_url":/{gsub( /[,"]/,"", $2); print $2}')

Here is what is returned:
https://github.com/codacy/helm-ssm/releases/download/3.1.9/helm-ssm-linux-arm.tgz https://github.com/codacy/helm-ssm/releases/download/3.1.9/helm-ssm-linux.tgz

Due to this helm plugin install always fails if run on OS that return linux to this line:

OS=$(echo $(uname)|tr '[:upper:]' '[:lower:]')

Seems have been result of arm addition causing 2 entries in releases to match grep for 'linux'

@github-actions
Copy link

Internal ticket created : CY-5242

@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Nov 16, 2021
@github-actions github-actions bot changed the title [Bug]install-binary.sh running 2 URLs for OS=linux breaking 'helm plugin install' on linux [CY-5242] [Bug]install-binary.sh running 2 URLs for OS=linux breaking 'helm plugin install' on linux Nov 16, 2021
@johnphilipscs johnphilipscs changed the title [CY-5242] [Bug]install-binary.sh running 2 URLs for OS=linux breaking 'helm plugin install' on linux [CY-5242] [Bug]install-binary.sh returning 2 URLs for OS=linux breaking 'helm plugin install' on linux Nov 16, 2021
@aelnaggar
Copy link

we are facing the same issue hope that there is a fix soon

@romeritoCL
Copy link

Fast fix: Kahzerx@ead09b9

@romeritoCL
Copy link

romeritoCL commented Nov 16, 2021

@johnphilipscs and @aelnaggar i've fixed both issues on this PR: https://github.com/codacy/helm-ssm/pull/52/files

hope we have it merged soon.

@gedd-shelf
Copy link

Bumping this issue and hoping to get the PR merged soon!

@vdog
Copy link

vdog commented Dec 2, 2021

helm plugin add --version 3.1.8 https://github.com/codacy/helm-ssm

doesn't work either :(

here's a workaround i used for my .gitlab-ci.yaml after making my own helm-ssm-linux.tgz and committing it to my chart repo:

#  - helm plugin add https://github.com/codacy/helm-ssm
    - export HELM_PLUGIN_DIR=$(helm env | grep HELM_PLUGINS | cut -d\" -f2)/helm-ssm
    - mkdir -p $HELM_PLUGIN_DIR
    - mkdir -p _dist/helm-ssm
    - tar -xf helm-ssm-linux.tgz -C _dist/helm-ssm
    - cp -r _dist/helm-ssm/* $HELM_PLUGIN_DIR

which i cribbed from make install

@onlythere
Copy link

There is no need to make own archive, we can download it right from github

      - wget --quiet https://github.com/codacy/helm-ssm/releases/download/3.1.9/helm-ssm-linux.tgz
      - export HELM_PLUGIN_DIR=$(helm env | grep HELM_PLUGINS | cut -d\" -f2)/helm-ssm
      - mkdir -p $HELM_PLUGIN_DIR
      - mkdir -p _dist/helm-ssm
      - tar -xf helm-ssm-linux.tgz -C _dist/helm-ssm
      - cp -r _dist/helm-ssm/* $HELM_PLUGIN_DIR
      - rm -rf _dist/
      - helm ssm -h

@gaspo53
Copy link

gaspo53 commented May 15, 2022

Same happening here, using ROK8s scripts image from Fairwinds (Linux): https://rok8s-scripts.docs.fairwinds.com/ci-images/

bash-5.1# helm plugin add https://github.com/codacy/helm-ssm --debug [debug] vcs_installer.go:159: cloning https://github.com/codacy/helm-ssm to /root/.cache/helm/plugins/https-github.com-codacy-helm-ssm [debug] vcs_installer.go:91: copying /root/.cache/helm/plugins/https-github.com-codacy-helm-ssm to /root/.local/share/helm/plugins/helm-ssm plugin_install.go:82: [debug] loading plugin from /root/.local/share/helm/plugins/helm-ssm plugin.go:60: [debug] running install hook: /bin/sh -c $HELM_PLUGIN_DIR/install-binary.sh Downloading https://github.com/codacy/helm-ssm/releases/download/3.1.9/helm-ssm-linux-arm.tgz https://github.com/codacy/helm-ssm/releases/download/3.1.9/helm-ssm-linux.tgz curl: (3) URL using bad/illegal format or missing URL Failed to install helm-ssm For support, go to https://github.com/codacy/helm-ssm. Error: plugin install hook for "ssm" exited with error helm.go:88: [debug] plugin install hook for "ssm" exited with error main.runHook helm.sh/helm/v3/cmd/helm/plugin.go:67 main.(*pluginInstallOptions).run helm.sh/helm/v3/cmd/helm/plugin_install.go:88 main.newPluginInstallCmd.func3 helm.sh/helm/v3/cmd/helm/plugin_install.go:59 github.com/spf13/cobra.(*Command).execute github.com/spf13/[email protected]/command.go:852 github.com/spf13/cobra.(*Command).ExecuteC github.com/spf13/[email protected]/command.go:960 github.com/spf13/cobra.(*Command).Execute github.com/spf13/[email protected]/command.go:897 main.main helm.sh/helm/v3/cmd/helm/helm.go:87 runtime.main runtime/proc.go:225 runtime.goexit runtime/asm_amd64.s:1371

@SamDrobakha
Copy link

Same here, got 2 links on a linux box during docker file creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

8 participants