Skip to content

Commit deb5d1d

Browse files
prompt check before proceed
1 parent 07429ae commit deb5d1d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2836,7 +2836,13 @@ def get_migrate_vmas_to_vms(self) -> bool:
28362836
28372837
:return: bool
28382838
"""
2839-
return self.raw_param.get("migrate_vmas_to_vms")
2839+
migrate_vmas_to_vms = self.raw_param.get("migrate_vmas_to_vms")
2840+
if migrate_vmas_to_vms:
2841+
msg = "This node image upgrade operation will run across every node pool in the cluster " \
2842+
"and might take a while. Do you wish to continue?"
2843+
if not self.context.get_yes() and not prompt_y_n(msg, default="n"):
2844+
return None
2845+
return migrate_vmas_to_vms
28402846

28412847

28422848
# 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
@@ -15956,7 +15956,7 @@ def test_aks_loadbalancer_commands(
1595615956
# # update -- migrate vmas to vma
1595715957
# update_cmd = (
1595815958
# "aks update --resource-group {resource_group} --name {name} "
15959-
# "--migrate-vmas-to-vms "
15959+
# "--migrate-vmas-to-vms --yes "
1596015960
# )
1596115961
# self.cmd(update_cmd, checks=[
1596215962
# self.check('provisioningState', 'Succeeded'),

0 commit comments

Comments
 (0)