Skip to content

Fixes the Polaris download URL#1200

Open
piar1989 wants to merge 1 commit into
FairwindsOps:masterfrom
piar1989:gha/fix_broken_download_link
Open

Fixes the Polaris download URL#1200
piar1989 wants to merge 1 commit into
FairwindsOps:masterfrom
piar1989:gha/fix_broken_download_link

Conversation

@piar1989

Copy link
Copy Markdown

This PR fixes #1199

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

The goal of this PR is to fix a bug in get_polaris.sh where the script fails to download the Polaris binary for recent releases due to a mismatch in the release asset naming convention.

What changes did you make?

I updated the POLARIS_URL construction inside get_polaris.sh. It now dynamically strips the "v" prefix from the $INPUT_VERSION variable using tr -d "v" specifically for the asset filename part of the URL, while keeping the full tag for the download path.

What alternative solution should we consider, if any?

None. This is the most straightforward and lightweight way to handle the version string adjustment directly inside the Bash script without adding external dependencies.

@vitorvezani vitorvezani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @piar1989, to be backwards compatible, I think we will need something like this

if [[ "$INPUT_VERSION" == v* ]]; then
  POLARIS_URL=https://github.com/FairwindsOps/polaris/releases/download/$INPUT_VERSION/polaris_$(echo -n $INPUT_VERSION | tr -d "v")_linux_amd64.tar.gz
else
  POLARIS_URL=https://github.com/FairwindsOps/polaris/releases/download/$INPUT_VERSION/polaris_linux_amd64.tar.gz
fi

So that if old patterns are used, we still resolve to correct URL, i.e.:

  • https://github.com/FairwindsOps/polaris/releases/download/4.2.0/polaris_linux_amd64.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: get_polaris.sh script fails to download release due to asset naming mismatch

2 participants