From e202577cac51a4c32ae82a9052c2cdf008628e62 Mon Sep 17 00:00:00 2001 From: HungWei Chiu Date: Sun, 3 Apr 2022 09:12:57 -0700 Subject: [PATCH] Fix the arch check of jq in Mac M1 environment - No official arm64 build for now but the current amd64 binary works for the M1 env, should change to the arm64 binary once jq has official arm64 version in its Github release. - Reference Github issue: https://github.com/stedolan/jq/issues/2386 Signed-off-by: HungWei Chiu --- pkg/get/get_test.go | 5 +++++ pkg/get/tools.go | 2 ++ 2 files changed, 7 insertions(+) diff --git a/pkg/get/get_test.go b/pkg/get/get_test.go index fa1a68a19..99f74ef6a 100644 --- a/pkg/get/get_test.go +++ b/pkg/get/get_test.go @@ -2460,6 +2460,11 @@ func Test_DownloadJq(t *testing.T) { arch: arch64bit, url: prefix + "jq-osx-amd64", }, + { + os: "darwin", + arch: "arm64", + url: prefix + "jq-osx-amd64", + }, { os: "linux", arch: arch64bit, diff --git a/pkg/get/tools.go b/pkg/get/tools.go index 0a7821596..630c698d7 100644 --- a/pkg/get/tools.go +++ b/pkg/get/tools.go @@ -107,6 +107,8 @@ helmfile_{{$os}}_{{$arch}}{{$ext}}`, {{- if eq .Arch "x86_64" -}} {{$arch = "64"}} +{{- else if eq .Arch "arm64" -}} +{{$arch = "64"}} {{- else -}} {{$arch = "32"}} {{- end -}}