install_kustomize: support linux/aarch64, with fallback to old behavior
In docker on an M1 Mac -- and probably also on any ARM linux machine, the value for uname -m is aarch64.
The install script only detects arm64 (which is the ARM uname value for native darwin).
Since the default is amd64, this leads to the script installing the wrong (amd64) version on ARM docker, instead of the arm64 version.
Caveat:
I appreciate that some people might be using this script to install older versions (which might not have an arm64 build yet), and have qemu-binfmt-misc installed, so this approach worked for them (but sometimes crashes, at least on M1 machines, a different issue). That's why I added a fallback that goes back to the old behavior if the arm64 binary does not exist.
Also fixed some shellcheck issues.
Any comments and feedback appreciated :)
@cfstras: This PR has multiple commits, and the default merge method is: merge. You can request commits to be squashed using the label: tide/merge-method-squash
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: cfstras / name: Claus F. Strasburger (a329c99b2773092c3de9c1e1a4a784232c4980a4, 7cbf548580f32fd5ead80653fec5a32b622791e6)
Welcome @cfstras!
It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @cfstras. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/label tide/merge-method-squash
Currently waiting from my org for CLA approval.
Got the CLA squared ✅ /assign @natasha41575
/assign knverey yuwenma
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: cfstras
Once this PR has been reviewed and has the lgtm label, please ask for approval from knverey by writing /assign @knverey in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@cfstras Any chance you could update your script based on the comments to get this merged? Although I'd be happy with just:
112c112
< arm64)
---
> arm64 | aarch64)
Since it works just fine in Ubuntu 22.04.01. I'm not sure how important those old "qemu-hacks" are to support in the installation scripts, seems to add a lot of extra stuff just to maintain them.
@burmanm sorry, not sure what you mean exactly? I've already updated it to arm64 | aarch64 a while ago.
@cfstras But there's still the "if [[ "$(uname -m)" == "aarch64" ]]; then" unfixed as mentioned in the comment. So nothing uses aarch64. Is this PR missing a commit?
@burmanm apologies, I didn't get to this until now. My last fixes seem not to have made the push, so I addressed all comments and did a round of testing now.
I'm using $arch directly now, which makes it a bit easier.
CC @KnVerey if you could take another look please? :)
/cc @koba1t
I think this script is working well. Thanks for your contribution!
/lgtm
/ok-to-test
The Github Actions button also showed up after the rebase, and they're running now too!
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: cfstras, KnVerey
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [KnVerey]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment