Skip to content

Commit aeba916

Browse files
committed
Resolve PR comments
1 parent 2a973fa commit aeba916

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
@@ -258,6 +258,11 @@
258258
]
259259

260260
# azure container storage
261+
container_storage_versions = [
262+
"1",
263+
"2"
264+
]
265+
261266
storage_pool_types = [
262267
CONST_STORAGE_POOL_TYPE_AZURE_DISK,
263268
CONST_STORAGE_POOL_TYPE_EPHEMERAL_DISK,
@@ -515,6 +520,7 @@ def load_arguments(self, _):
515520
)
516521
c.argument(
517522
"container_storage_version",
523+
arg_type=get_enum_type(container_storage_versions),
518524
help="set azure container storage version, the latest version will be installed by default",
519525
)
520526
c.argument(
@@ -723,6 +729,7 @@ def load_arguments(self, _):
723729
)
724730
c.argument(
725731
"container_storage_version",
732+
arg_type=get_enum_type(container_storage_versions),
726733
help="set azure container storage version, the latest version will be installed by default",
727734
)
728735
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)