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

fix(install): fix packer version check in post install script. #1115

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

himanhsugusain
Copy link
Contributor

This attempt to fix the packer version check , which on failing would trigger a new download even if the same packer version is correctly insatalled.

This is an issue where packer for the arch type does not exists ( 404 ), eg. vm, docker images etc.

--2024-11-12 07:45:06--  https://releases.hashicorp.com/packer/1.10.1/packer_1.10.1_linux_.zip
Resolving releases.hashicorp.com (releases.hashicorp.com)... 99.86.20.99, 99.86.20.59, 99.86.20.95, ...
Connecting to releases.hashicorp.com (releases.hashicorp.com)|99.86.20.99|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-11-12 07:45:07 ERROR 404: Not Found.

packer version output format

himanshu@ubuntu-vm:~$ /usr/bin/packer  --version
Packer v1.10.1

Your version of Packer is out of date! The latest version
is 1.11.2. You can update by downloading from www.packer.io/downloads

Copy link
Member

@jasonmcintosh jasonmcintosh left a comment

Choose a reason for hiding this comment

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

LOOKS like this should do it, but don't have a great test for it right now ;) Still approving as these are only used in the debian installations.

@ashleykleynhans
Copy link
Contributor

LOOKS like this should do it, but don't have a great test for it right now ;) Still approving as these are only used in the debian installations.

Confirmed that the previous code:

 if [ $packer_status -ne 0 ] || [ "$packer_version" != "$PACKER_VERSION" ]; then

Does NOT match the version correctly because $packer_version is Packer v1.10.1 but $PACKER_VERSION is 1.10.1.

But the new code:

if [ $packer_status -ne 0 ] || ! grep -q "$PACKER_VERSION" <<< "$packer_version" ; then

DOES match the partial version number of 1.10.1 within the $packer_version string of Packer v1.10.1,

@jasonmcintosh jasonmcintosh added the ready to merge Approved and ready for merge label Nov 13, 2024
@mergify mergify bot added the auto merged label Nov 13, 2024
@mergify mergify bot merged commit 1c338ea into spinnaker:master Nov 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants