Skip to content

Commit e1741a2

Browse files
authored
Add param force to az vme uninstall (#8901)
1 parent 4e361b1 commit e1741a2

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

src/vme/HISTORY.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ Release History
1414
1.0.0b3
1515
++++++
1616
* Update 'az vme list --output table' to show correct versions.
17-
* Wait for the bundle feature flag to fully propagate after enabling it.
17+
* Wait for the bundle feature flag to fully propagate after enabling it.
18+
19+
1.0.0b4
20+
++++++
21+
* Add '--force' to 'az vme uninstall' to force delete extension.

src/vme/azext_vme/_params.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def load_arguments(self, _):
9292
help='Extension types to be uninstalled.',
9393
arg_type=get_enum_type(IncludedExtensionTypes),
9494
)
95+
c.argument(
96+
'force',
97+
help='Specify whether to force delete the extension from the cluster.',
98+
)
9599

96100
with self.argument_context('vme list') as c:
97101
c.argument(

src/vme/azext_vme/custom.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def uninstall_vme(
8181
cmd,
8282
resource_group_name: str,
8383
cluster_name: str,
84-
include_extension_types: list[str]):
84+
include_extension_types: list[str],
85+
force=False):
8586
if 'all' in include_extension_types:
8687
include_extension_types = consts.BundleExtensionTypes
8788
subscription_id = get_subscription_id(cmd.cli_ctx)
@@ -108,8 +109,9 @@ def uninstall_vme(
108109
"connectedClusters",
109110
"--name",
110111
consts.BundleExtensionTypeNames[extension_type],
111-
"--force",
112112
"--yes"]
113+
if force:
114+
command.append("--force")
113115
utils.call_subprocess_raise_output(command)
114116
print(f"Uninstalled extension {extension_type} successfully.")
115117
if len(include_extension_types) > 1:

src/vme/azext_vme/tests/latest/test_vme_scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ def test_vme_live(self, resource_group, resource_group_location):
7272

7373
captured_output = io.StringIO()
7474
with redirect_stdout(captured_output):
75-
self.cmd("vme uninstall -g {rg} -c {cluster_name} --include all")
75+
self.cmd("vme uninstall -g {rg} -c {cluster_name} --include all --force")
7676
self.assertIn("All extensions uninstalled successfully.", captured_output.getvalue())

src/vme/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import setup, find_packages
1111

1212
# HISTORY.rst entry.
13-
VERSION = '1.0.0b3'
13+
VERSION = '1.0.0b4'
1414

1515
# The full list of classifiers is available at
1616
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)