Skip to content

Commit 8326f03

Browse files
author
reneeli@microsoft.com
committed
prompt check before proceed
1 parent 4f024df commit 8326f03

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,13 @@ def get_migrate_vmas_to_vms(self) -> bool:
28212821
28222822
:return: bool
28232823
"""
2824-
return self.raw_param.get("migrate_vmas_to_vms")
2824+
migrate_vmas_to_vms = self.raw_param.get("migrate_vmas_to_vms")
2825+
if migrate_vmas_to_vms:
2826+
msg = "This node image upgrade operation will run across every node pool in the cluster " \
2827+
"and might take a while. Do you wish to continue?"
2828+
if not self.context.get_yes() and not prompt_y_n(msg, default="n"):
2829+
return None
2830+
return migrate_vmas_to_vms
28252831

28262832

28272833
# pylint: disable=too-many-public-methods

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15895,7 +15895,7 @@ def test_aks_loadbalancer_commands(
1589515895
# # update -- migrate vmas to vma
1589615896
# update_cmd = (
1589715897
# "aks update --resource-group {resource_group} --name {name} "
15898-
# "--migrate-vmas-to-vms "
15898+
# "--migrate-vmas-to-vms --yes "
1589915899
# )
1590015900
# self.cmd(update_cmd, checks=[
1590115901
# self.check('provisioningState', 'Succeeded'),

0 commit comments

Comments
 (0)