-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix krew on Apple silicon #837
Conversation
Signed-off-by: Richard Gee <richard@technologee.co.uk>
@@ -3312,38 +3312,56 @@ func Test_DownloadKrew(t *testing.T) { | |||
{ | |||
os: "darwin", | |||
arch: arch64bit, | |||
version: "v0.4.2", | |||
url: `https://github.com/kubernetes-sigs/krew/releases/download/v0.4.2/krew-darwin_amd64.tar.gz`, | |||
version: "v0.4.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump the version to current krew release
@@ -3354,7 +3372,7 @@ func Test_DownloadKrew(t *testing.T) { | |||
t.Fatal(err) | |||
} | |||
if got != tc.url { | |||
t.Errorf("want: %s, got: %s", tc.url, got) | |||
t.Errorf("want: %s for %s on %s, got: %s", tc.url, tc.os, tc.arch, got) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added additional detail here because where multiple OS and Arch combinations target a single URI it is challenging to find the failing test case.
Url check failing on a unrelated tool:
Actual link is:
Note the v prefix in the filename portion. |
Signed-off-by: Richard Gee <richard@technologee.co.uk>
@@ -1139,7 +1139,7 @@ https://releases.hashicorp.com/{{.Name}}/{{.Version}}/{{.Name}}_{{.Version}}_{{$ | |||
{{$os = "windows"}} | |||
{{- end -}} | |||
|
|||
{{.Version}}/{{.Name}}_{{.VersionNumber}}_{{$os}}_{{$arch}}.tar.gz`, | |||
{{.Version}}/{{.Name}}_v{{.VersionNumber}}_{{$os}}_{{$arch}}.tar.gz`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this in a later commit after the url checker tests failed in the CI. Kail seem to have changed the asset names from v0.16.0
pkg/get/get_test.go
Outdated
url: `https://github.com/kubernetes-sigs/krew/releases/download/v0.4.3/krew-darwin_arm64.tar.gz`, | ||
}, | ||
{ | ||
os: "ming", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this entry for? Windows + MacOS 64-bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I meant to comment here: https://github.com/alexellis/arkade/pull/837/files#diff-6e1468cd6d67c262166efacb61ddf1e9dbb404be9ca1acd3ce0c2c2abc95a741R1031
To the effect that i didn't understand the darwin entry under ming but added the additional arch entry for consistency
pkg/get/get_test.go
Outdated
version: "v0.4.2", | ||
url: `https://github.com/kubernetes-sigs/krew/releases/download/v0.4.2/krew-darwin_amd64.tar.gz`, | ||
version: "v0.4.3", | ||
url: `https://github.com/kubernetes-sigs/krew/releases/download/v0.4.3/krew-darwin_amd64.tar.gz`, | ||
}, | ||
{ | ||
os: "darwin", | ||
arch: archARM64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test may have been wrong in the first place, since the value should be archDarwinARM64 from uname
on MacOS M1
Darwin am1.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64
cc @Jasstkn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should be archDarwinARM64
.
Signed-off-by: Richard Gee <richard@technologee.co.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Signed-off-by: Richard Gee richard@technologee.co.uk
Description
Adds
arm64
fordarwin
into the tool templates as #836 looks like a possible Apple silicon gap.There was a
darwin_arm64
entry under theming
path in the template, so theor
has been added in there too.Motivation and Context
design/approved
by a maintainerMight fix #836 - would have been more certain had @bayeslearner completed the issue template.
How Has This Been Tested?
Added unit tests but haven't been able to test as I don't have apple silicon. Maybe @bayeslearner can help? Here's how
Are you a GitHub Sponsor yet (Yes/No?)
Types of changes
Documentation
./arkade get -o markdown
./arkade install --help
Checklist:
git commit -s