Skip to content

Commit

Permalink
Silently assume arm=v7, arm64=v8 on macOS
Browse files Browse the repository at this point in the history
This follows the logic we already use for Windows, and matches
the containerd/platforms package.

Fixes #2376.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed May 13, 2024
1 parent 9318d0e commit 4067593
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/pkg/platform/platform_matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func getCPUInfo(pattern string) (info string, err error) {
return "", fmt.Errorf("getCPUInfo for pattern: %s not found", pattern)
}

func getCPUVariantWindows(arch string) string {
// Windows only supports v7 for ARM32 and v8 for ARM64 and so we can use
func getCPUVariantDarwinWindows(arch string) string {
// Darwin and Windows only support v7 for ARM32 and v8 for ARM64 and so we can use
// runtime.GOARCH to determine the variants
var variant string
switch arch {
Expand Down Expand Up @@ -133,8 +133,8 @@ func getCPUVariantArm() string {
}

func getCPUVariant(os string, arch string) string {
if os == "windows" {
return getCPUVariantWindows(arch)
if os == "darwin" || os == "windows" {
return getCPUVariantDarwinWindows(arch)
}
if arch == "arm" || arch == "arm64" {
return getCPUVariantArm()
Expand Down

0 comments on commit 4067593

Please sign in to comment.