From 98e0af378cd5eac696735dc629c03cf9e9ce08ca 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 de134f431..c378bf9a7 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 e4d8b6b55..8c414846a 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 -}}