kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

install_kustomize: support linux/aarch64, with fallback to old behavior

Open cfstras opened this issue 3 years ago • 12 comments

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 avatar May 05 '22 12:05 cfstras

@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.

k8s-ci-robot avatar May 05 '22 12:05 k8s-ci-robot

CLA Signed

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:

k8s-ci-robot avatar May 05 '22 12:05 k8s-ci-robot

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.

k8s-ci-robot avatar May 05 '22 12:05 k8s-ci-robot

/label tide/merge-method-squash

Currently waiting from my org for CLA approval.

cfstras avatar May 05 '22 12:05 cfstras

Got the CLA squared ✅ /assign @natasha41575

cfstras avatar May 06 '22 10:05 cfstras

/assign knverey yuwenma

cfstras avatar Jun 23 '22 13:06 cfstras

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jul 28 '22 13:07 k8s-ci-robot

@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 avatar Sep 29 '22 13:09 burmanm

@burmanm sorry, not sure what you mean exactly? I've already updated it to arm64 | aarch64 a while ago.

cfstras avatar Sep 30 '22 14:09 cfstras

@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 avatar Sep 30 '22 14:09 burmanm

@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? :)

cfstras avatar Oct 13 '22 09:10 cfstras

/cc @koba1t

KnVerey avatar Nov 22 '22 01:11 KnVerey

I think this script is working well. Thanks for your contribution!

/lgtm

koba1t avatar Nov 22 '22 17:11 koba1t

/ok-to-test

The Github Actions button also showed up after the rebase, and they're running now too!

KnVerey avatar Nov 24 '22 17:11 KnVerey

/lgtm /approve

KnVerey avatar Nov 24 '22 18:11 KnVerey

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Nov 24 '22 18:11 k8s-ci-robot