-
-
Notifications
You must be signed in to change notification settings - Fork 298
fix(kustomize): use VersionStrategy instead #1173
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
base: master
Are you sure you want to change the base?
Conversation
What happens if you replace the version with a version strategy? https://github.com/alexellis/arkade/blob/master/pkg/get/tools.go#L57 |
Dear lord, of course. I changed the issue, PR and commit to reflect this. Local test:
|
Whilst I'd prefer more output in the testing section - the minimal output to provide is created by running the provided command - this change looks reasonable to me. @alexellis do you want to take this, or prefer that it be addressed as an aside in a future change? |
@toredash I see a 404 on the windows side of things despite the asset being available in the releases. Can we get the template updated to fix windows and accommodate the arm64 variant? Test-Tool➜ arkade git:(patch-1) ./hack/test-tool.sh kustomize
+ ./arkade get kustomize --arch arm64 --os darwin --quiet
+ file /Users/rgee0/.arkade/bin/kustomize
/Users/rgee0/.arkade/bin/kustomize: Mach-O 64-bit executable x86_64
+ rm /Users/rgee0/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os darwin --quiet
+ file /Users/rgee0/.arkade/bin/kustomize
/Users/rgee0/.arkade/bin/kustomize: Mach-O 64-bit executable x86_64
+ rm /Users/rgee0/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os linux --quiet
+ file /Users/rgee0/.arkade/bin/kustomize
/Users/rgee0/.arkade/bin/kustomize: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=L7P0yqIUAWCZhV2ri962/kcEj5SGtOb-SSSmxJcaW/YMgj_aP1GxdFt5HvaONj/oFb_grNdglDJmnYtdrvA, stripped
+ rm /Users/rgee0/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch aarch64 --os linux --quiet
+ file /Users/rgee0/.arkade/bin/kustomize
/Users/rgee0/.arkade/bin/kustomize: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=BtU9qNXZoGNA0R0tZaPD/mHy9T4GeOPsmAuDuvz16/pE4izn79t9ydJVABBdGS/DNEGocbI27BZEs5DoHuk, stripped
+ rm /Users/rgee0/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os mingw --quiet
The requested version of kustomize is not available or configured in arkade for mingw/x86_64
* Check if a binary is available from the project for your Operating System
* View the kustomize releases page: https://github.com/kubernetes-sigs/kustomize/releases
* Feel free to raise an issue at https://github.com/alexellis/arkade/issues for help
Error: server returned status: 404 Functional➜ arkade git:(patch-1) ./arkade get kustomize
Downloading: kustomize
2025/05/29 06:08:22 Looking up version for: kustomize
2025/05/29 06:08:22 Found: v5.6.0
Downloading: https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.6.0/kustomize_v5.6.0_darwin_amd64.tar.gz
5.56 MiB / 5.56 MiB [--------------------------------------------------------------------] 100.00%
/var/folders/22/3b_f27kj3s37lbfqz_fq44jw0000gp/T/arkade-1271927638/kustomize_v5.6.0_darwin_amd64.tar.gz written.
2025/05/29 06:08:22 Extracted: /var/folders/22/3b_f27kj3s37lbfqz_fq44jw0000gp/T/arkade-1271927638/kustomize
2025/05/29 06:08:22 Copying /var/folders/22/3b_f27kj3s37lbfqz_fq44jw0000gp/T/arkade-1271927638/kustomize to /Users/rgee0/.arkade/bin/kustomize
Wrote: /Users/rgee0/.arkade/bin/kustomize (14.74MB)
# Add arkade binary directory to your PATH variable
export PATH=$PATH:$HOME/.arkade/bin/
# Test the binary:
/Users/rgee0/.arkade/bin/kustomize
# Or install with:
sudo mv /Users/rgee0/.arkade/bin/kustomize /usr/local/bin/
👏 Say thanks for arkade and sponsor Alex via GitHub: https://github.com/sponsors/alexellis |
There was a reason why it was done this way - I think because semver had issues locating the proper release - since the kustomize repo was releasing multiple releases all with different suffixes and a version strategy could pick the wrong one depending on what was released last. I assume that is still the case. I would advise checking back and seeing. |
Its a good spot Alex. Although The irregular approach to tagging that is used on kustomize appears to be accommodated by the arkade approach to resolving the version, but https://github.com/kubernetes-sigs/kustomize/releases show you where the potential dragons are. Its particularly easy to fall into the trap since the version strategy approach was introduced 8 months ago while the last time the kustomize version was updated was 2 years ago, leading you to believe that the previous problem may have been alleviated by more recent changes, however, I'm of the view that if one of the other tag prefixes found itself being provided by |
Thank you for your contribution. unfortunately, one or more of your commits are missing the required "Signed-off-by:" statement. Signing off is part of the Developer Certificate of Origin (DCO) which is used by this project. Read the DCO and project contributing guide carefully, and amend your commits using the git CLI. Note that this does not require any cryptography, keys or special steps to be taken. 💡 Shall we fix this?This will only take a few moments. First, clone your fork and checkout this branch using the git CLI. Next, set up your real name and email address:
Finally, run one of these commands to add the "Signed-off-by" line to your commits. If you only have one commit so far then run: Check that the message has been added properly by running "git log". |
By using VersionStrategy the latest released version of kustomize will be used Update BinaryTemplate to support the different releases Signed-off-by: Tore Lønøy <[email protected]>
@rgee0 Updated the binary template as requested, and the test tool is expanded to cover the arm cases. % ./hack/test-tool.sh kustomize
+ ./arkade get kustomize --arch arm64 --os darwin --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize
/Users/tlonoy/.arkade/bin/kustomize: Mach-O 64-bit executable x86_64
+ rm /Users/tlonoy/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os darwin --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize
/Users/tlonoy/.arkade/bin/kustomize: Mach-O 64-bit executable x86_64
+ rm /Users/tlonoy/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os linux --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize
/Users/tlonoy/.arkade/bin/kustomize: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=L7P0yqIUAWCZhV2ri962/kcEj5SGtOb-SSSmxJcaW/YMgj_aP1GxdFt5HvaONj/oFb_grNdglDJmnYtdrvA, stripped
+ rm /Users/tlonoy/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch aarch64 --os linux --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize
/Users/tlonoy/.arkade/bin/kustomize: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=BtU9qNXZoGNA0R0tZaPD/mHy9T4GeOPsmAuDuvz16/pE4izn79t9ydJVABBdGS/DNEGocbI27BZEs5DoHuk, stripped
+ rm /Users/tlonoy/.arkade/bin/kustomize
+ echo
+ ./arkade get kustomize --arch x86_64 --os mingw --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize.exe
/Users/tlonoy/.arkade/bin/kustomize.exe: PE32+ executable (console) x86-64, for MS Windows
+ rm /Users/tlonoy/.arkade/bin/kustomize.exe
+ echo
+ ./arkade get kustomize --arch aarch64 --os mingw --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize.exe
/Users/tlonoy/.arkade/bin/kustomize.exe: PE32+ executable (console) Aarch64, for MS Windows
+ rm /Users/tlonoy/.arkade/bin/kustomize.exe
+ echo
+ ./arkade get kustomize --arch arm64 --os mingw --quiet
+ file /Users/tlonoy/.arkade/bin/kustomize.exe
/Users/tlonoy/.arkade/bin/kustomize.exe: PE32+ executable (console) Aarch64, for MS Windows
+ rm /Users/tlonoy/.arkade/bin/kustomize.exe
+ echo |
Description
Update kustomize tool to use the VersionStrategy of type Github instead of hard-coded value.
closes #1172
Motivation and Context
design/approved
by a maintainer (required) (I cheated)How Has This Been Tested?
If updating or adding a new CLI to
arkade get
, run:Types of changes
Documentation
./arkade get --format markdown
./arkade install --help
Checklist:
git commit -s