Skip to content

Commit 4185ce8

Browse files
author
Bavneet Singh
committed
remove change not relevant to connectedk8s release
1 parent a160168 commit 4185ce8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/k8s-extension/azext_k8s_extension/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ def install_helm_client(cmd: CLICommand) -> str:
763763
"Downloading helm client for first time. This can take few minutes..."
764764
)
765765

766-
mcr_url = utils.get_mcr_path(cmd.cli_ctx.cloud.endpoints.active_directory)
766+
mcr_url = utils.get_mcr_path(cmd)
767767

768768
client = oras.client.OrasClient(hostname=mcr_url)
769769
retry_count = 3

src/k8s-extension/azext_k8s_extension/utils.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,11 @@ def create_folder_diagnosticlogs(folder_name: str, base_folder_name: str) -> tup
361361
)
362362
return "", False
363363

364-
def get_mcr_path(active_directory_endpoint: str) -> str:
365-
active_directory_array = active_directory_endpoint.split(".")
364+
def get_mcr_path(cmd: CLICommand) -> str:
365+
active_directory_array = cmd.cli_ctx.cloud.endpoints.active_directory.split(".")
366366

367-
# For US Government and China clouds, use public mcr
368-
if active_directory_endpoint.endswith((".us", ".cn")):
369-
return "mcr.microsoft.com"
370-
371-
# Default MCR postfix
372-
mcr_postfix = "com"
367+
# default for public, mc, ff clouds
368+
mcr_postfix = active_directory_array[2]
373369
# special cases for USSec, exclude part of suffix
374370
if len(active_directory_array) == 4 and active_directory_array[2] == "microsoft":
375371
mcr_postfix = active_directory_array[3]

0 commit comments

Comments
 (0)