Skip to content

Commit 919be4f

Browse files
committed
pr comments
1 parent 370e5c1 commit 919be4f

File tree

5 files changed

+1065
-572
lines changed

5 files changed

+1065
-572
lines changed

src/azure-cli/azure/cli/command_modules/acs/custom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,6 @@ def aks_update(
843843
try:
844844
# update mc profile
845845
mc = aks_update_decorator.update_mc_profile_default()
846-
# Update kubernetes_version and orchestrator_version based on auto_upgrade_channel
847-
mc = aks_update_decorator.update_kubernetes_version_and_orchestrator_version(mc)
848846
except DecoratorEarlyExitException:
849847
# exit gracefully
850848
return None

src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
CONST_PRIVATE_DNS_ZONE_CONTRIBUTOR_ROLE,
4242
CONST_DNS_ZONE_CONTRIBUTOR_ROLE,
4343
CONST_ARTIFACT_SOURCE_CACHE,
44+
CONST_NONE_UPGRADE_CHANNEL,
4445
)
4546
from azure.cli.command_modules.acs._helpers import (
4647
check_is_managed_aad_cluster,
@@ -8482,6 +8483,8 @@ def update_mc_profile_default(self) -> ManagedCluster:
84828483
mc = self.update_node_resource_group_profile(mc)
84838484
# update bootstrap profile
84848485
mc = self.update_bootstrap_profile(mc)
8486+
# update kubernetes version and orchestrator version
8487+
mc = self.update_kubernetes_version_and_orchestrator_version(mc)
84858488
return mc
84868489

84878490
def update_kubernetes_version_and_orchestrator_version(self, mc: ManagedCluster) -> ManagedCluster:
@@ -8494,14 +8497,14 @@ def update_kubernetes_version_and_orchestrator_version(self, mc: ManagedCluster)
84948497

84958498
# Check if auto_upgrade_channel is set to "none"
84968499
auto_upgrade_channel = self.context.get_auto_upgrade_channel()
8497-
if auto_upgrade_channel == "none":
8500+
if auto_upgrade_channel == CONST_NONE_UPGRADE_CHANNEL:
84988501
warning_message = (
84998502
"Since auto-upgrade-channel is set to none, cluster kubernetesVersion will be set to the value of "
85008503
"currentKubernetesVersion, all agent pools orchestratorVersion will be set to the value of "
85018504
"currentOrchestratorVersion respectively. Continue?"
85028505
)
8503-
if not prompt_y_n(warning_message, default="n"):
8504-
raise CLIError("Operation cancelled by user.")
8506+
if not self.context.get_yes() and not prompt_y_n(warning_message, default="n"):
8507+
raise DecoratorEarlyExitException()
85058508

85068509
# Set kubernetes version to match the current kubernetes version if it has a value
85078510
if mc.current_kubernetes_version:

0 commit comments

Comments
 (0)