From 91f65b3441d92ed1d5d077f0dcdbb3997dda89dd Mon Sep 17 00:00:00 2001 From: John Matthews Date: Sat, 29 Jan 2022 11:17:48 -0500 Subject: [PATCH 1/2] Install arch appropriate build if the 'arch' command is present --- hack/install_kustomize.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index 2af293d30..3c2395dfe 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -95,13 +95,17 @@ trap cleanup EXIT ERR pushd "$tmpDir" >& /dev/null opsys=windows -arch=amd64 if [[ "$OSTYPE" == linux* ]]; then opsys=linux elif [[ "$OSTYPE" == darwin* ]]; then opsys=darwin fi +arch=amd64 +if command -v arch &> /dev/null; then + arch=$(arch) +fi + releases=$(curl -s $release_url) if [[ $releases == *"API rate limit exceeded"* ]]; then From 4f5dfb5d429f1566fc88b089d3de8fc821727e5e Mon Sep 17 00:00:00 2001 From: John Matthews Date: Thu, 3 Feb 2022 16:55:54 -0500 Subject: [PATCH 2/2] Updating with 'uname -m' --- hack/install_kustomize.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hack/install_kustomize.sh b/hack/install_kustomize.sh index 3c2395dfe..0e671aefa 100755 --- a/hack/install_kustomize.sh +++ b/hack/install_kustomize.sh @@ -101,10 +101,24 @@ elif [[ "$OSTYPE" == darwin* ]]; then opsys=darwin fi -arch=amd64 -if command -v arch &> /dev/null; then - arch=$(arch) -fi +# Supported values of 'arch': amd64, arm64, ppc64le, s390x +case $(uname -m) in +x86_64) + arch=amd64 + ;; +arm64) + arch=arm64 + ;; +ppc64le) + arch=ppc64le + ;; +s390x) + arch=s390x + ;; +*) + arch=amd64 + ;; +esac releases=$(curl -s $release_url)