4141 CONST_PRIVATE_DNS_ZONE_CONTRIBUTOR_ROLE ,
4242 CONST_DNS_ZONE_CONTRIBUTOR_ROLE ,
4343 CONST_ARTIFACT_SOURCE_CACHE ,
44+ CONST_NONE_UPGRADE_CHANNEL ,
4445)
4546from 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