Skip to content

Commit f472334

Browse files
committed
Resolve PR comments
1 parent c0fa361 commit f472334

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@
259259
]
260260

261261
# azure container storage
262+
container_storage_versions = [
263+
"1",
264+
"2"
265+
]
266+
262267
storage_pool_types = [
263268
CONST_STORAGE_POOL_TYPE_AZURE_DISK,
264269
CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK,
@@ -516,6 +521,7 @@ def load_arguments(self, _):
516521
)
517522
c.argument(
518523
"container_storage_version",
524+
arg_type=get_enum_type(container_storage_versions),
519525
help="set azure container storage version, the latest version will be installed by default",
520526
)
521527
c.argument(
@@ -724,6 +730,7 @@ def load_arguments(self, _):
724730
)
725731
c.argument(
726732
"container_storage_version",
733+
arg_type=get_enum_type(container_storage_versions),
727734
help="set azure container storage version, the latest version will be installed by default",
728735
)
729736
c.argument(

src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_consts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
CONST_ACSTOR_V1_K8S_EXTENSION_NAME = "microsoft.azurecontainerstorage"
1010
CONST_ACSTOR_V1_EXT_INSTALLATION_NAME = "azurecontainerstorage"
1111
CONST_ACSTOR_VERSION_V1 = "1"
12-
CONST_SUPPORTED_ACSTOR_VERSIONS = ("1", "2")
1312
CONST_DISK_TYPE_EPHEMERAL_VOLUME_ONLY = "EphemeralVolumeOnly"
1413
CONST_DISK_TYPE_PV_WITH_ANNOTATION = "PersistentVolumeWithAnnotation"
1514
CONST_EPHEMERAL_NVME_PERF_TIER_BASIC = "Basic"

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
CONST_ACSTOR_EXT_INSTALLATION_NAME,
5353
CONST_ACSTOR_V1_EXT_INSTALLATION_NAME,
5454
CONST_ACSTOR_VERSION_V1,
55-
CONST_SUPPORTED_ACSTOR_VERSIONS,
5655
)
5756
from azure.cli.command_modules.acs._helpers import (
5857
check_is_managed_aad_cluster,
@@ -6782,15 +6781,8 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
67826781
if self.context.raw_param.get("enable_azure_container_storage") is not None:
67836782
self.context.set_intermediate("enable_azure_container_storage", True, overwrite_exists=True)
67846783
container_storage_version = self.context.raw_param.get("container_storage_version")
6785-
has_container_storage_version = container_storage_version is not None
67866784

6787-
if has_container_storage_version and container_storage_version not in CONST_SUPPORTED_ACSTOR_VERSIONS:
6788-
raise InvalidArgumentValueError(
6789-
f'Version {container_storage_version} is not supported for enabling Azure Container Storage. '
6790-
f'The only supported versions are {", ".join(CONST_SUPPORTED_ACSTOR_VERSIONS)}'
6791-
)
6792-
6793-
if has_container_storage_version and container_storage_version == CONST_ACSTOR_VERSION_V1:
6785+
if container_storage_version is not None and container_storage_version == CONST_ACSTOR_VERSION_V1:
67946786
# read the azure container storage values passed
67956787
pool_type = self.context.raw_param.get("enable_azure_container_storage")
67966788
enable_azure_container_storage = pool_type is not None
@@ -8816,12 +8808,6 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
88168808
' Please remove this parameter and try again.'
88178809
)
88188810

8819-
if container_storage_version is not None and container_storage_version not in CONST_SUPPORTED_ACSTOR_VERSIONS:
8820-
raise InvalidArgumentValueError(
8821-
f'Version {container_storage_version} is not supported for enabling Azure Container Storage. '
8822-
f'The only supported versions are {CONST_SUPPORTED_ACSTOR_VERSIONS}'
8823-
)
8824-
88258811
if enable_azure_container_storage_param is not None or disable_azure_container_storage_param is not None:
88268812
self.context.set_intermediate("container_storage_version", container_storage_version, overwrite_exists=True)
88278813

0 commit comments

Comments
 (0)