Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down