From a464bfa36be9c429eebf5786381abe2fed05a64d Mon Sep 17 00:00:00 2001 From: Fuming Zhang Date: Tue, 4 Apr 2023 10:33:05 +0800 Subject: [PATCH] update --- .../azure/cli/command_modules/acs/custom.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index 991d1eddc44..7843eb2d72f 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -1475,11 +1475,18 @@ def k8s_install_cli(cmd, client_version='latest', install_location=None, base_sr # Note: the results returned here may be inaccurate if the installed python is translated (e.g. by Rosetta) def get_arch_for_cli_binary(): arch = platform.machine().lower() - # default arch - formatted_arch = "amd64" - # set to "arm64" when the detection value contains the word "arm" - if "arm" in arch: + if "amd64" in arch or "x86_64" in arch: + formatted_arch = "amd64" + elif "armv8" in arch or "aarch64" in arch: formatted_arch = "arm64" + else: + raise CLIInternalError( + "Unsupported architecture: '{}'. Currently only supports downloading the binary " + "of arm64/amd64 architecture for linux/darwin/windows platform, please download " + "the corresponding binary for other platforms or architectures by yourself".format( + arch + ) + ) logger.warning( "The detected architecture is '%s', which will be regarded as '%s' and " "the corresponding binary will be downloaded. "