Skip to content

Commit

Permalink
preflight: Add M1 support to CPU preflight check
Browse files Browse the repository at this point in the history
This check currently only allows x86_64 CPUs. This commit changes it to
also accept darwin/arm64 (aka M1)
  • Loading branch information
cfergeau authored and anjannath committed Jun 2, 2022
1 parent 861795d commit 7429468
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/crc/preflight/preflight_checks_nonwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ func fixOldAdminHelperExecutableCached() error {
}

func checkSupportedCPUArch() error {
if runtime.GOARCH != "amd64" {
logging.Debugf("GOARCH is %s", runtime.GOARCH)
return fmt.Errorf("CRC can only run on AMD64/Intel64 CPUs")
logging.Debugf("GOARCH is %s GOOS is %s", runtime.GOARCH, runtime.GOOS)
// Only supported arches are amd64, and arm64 on macOS
if runtime.GOARCH == "amd64" || (runtime.GOARCH == "arm64" && runtime.GOOS == "darwin") {
return nil
}
return nil
return fmt.Errorf("CRC can only run on AMD64/Intel64 CPUs and M1 CPUs")
}

func runtimeExecutablePath() (string, error) {
Expand Down

0 comments on commit 7429468

Please sign in to comment.