Skip to content

Commit a58dce0

Browse files
committed
fix live tests
1 parent f899619 commit a58dce0

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

src/aks-preview/azext_aks_preview/azurecontainerstorage/_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def _validate_nodepools( # pylint: disable=too-many-branches,too-many-locals
661661
'and retry the Azure Container Storage operation.'
662662
)
663663
vm_size = agentpool.get("vm_size")
664-
if vm_size is not None:
664+
if vm_size is not None and vm_size != "":
665665
cpu_value, nvme_enabled = get_vm_sku_details(vm_size.lower())
666666
if cpu_value is None or nvme_enabled is None:
667667
raise UnknownError(

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,10 +3598,10 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
35983598
# installing Azure Container Storage during `az aks create`
35993599
nodepool_list = agentpool.name
36003600

3601-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
3601+
from azext_aks_preview.azurecontainerstorage._validators import (
36023602
validate_enable_azure_container_storage_v1_params
36033603
)
3604-
from azure.cli.command_modules.acs.azurecontainerstorage._consts import (
3604+
from azext_aks_preview.azurecontainerstorage._consts import (
36053605
CONST_ACSTOR_IO_ENGINE_LABEL_KEY,
36063606
CONST_ACSTOR_IO_ENGINE_LABEL_VAL,
36073607
CONST_DISK_TYPE_EPHEMERAL_VOLUME_ONLY,
@@ -3672,7 +3672,7 @@ def set_up_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
36723672
pool_option = self.context.raw_param.get("storage_pool_option")
36733673
pool_size = self.context.raw_param.get("storage_pool_size")
36743674

3675-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
3675+
from azext_aks_preview.azurecontainerstorage._validators import (
36763676
validate_enable_azure_container_storage_params,
36773677
)
36783678
validate_enable_azure_container_storage_params(
@@ -4487,7 +4487,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
44874487
)
44884488

44894489
# Check if we are trying to disable container storage v1
4490-
from azure.cli.command_modules.acs.azurecontainerstorage._helpers import (
4490+
from azext_aks_preview.azurecontainerstorage._helpers import (
44914491
get_container_storage_extension_installed
44924492
)
44934493
try:
@@ -4549,7 +4549,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
45494549
pool_sku = self.context.raw_param.get("storage_pool_sku")
45504550
pool_size = self.context.raw_param.get("storage_pool_size")
45514551
agentpool_details = {}
4552-
from azure.cli.command_modules.acs.azurecontainerstorage._helpers import (
4552+
from azext_aks_preview.azurecontainerstorage._helpers import (
45534553
get_extension_installed_and_cluster_configs
45544554
)
45554555
try:
@@ -4586,7 +4586,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
45864586
self.context.set_intermediate("vm_cache_generated", True, overwrite_exists=True)
45874587

45884588
if enable_azure_container_storage:
4589-
from azure.cli.command_modules.acs.azurecontainerstorage._helpers import (
4589+
from azext_aks_preview.azurecontainerstorage._helpers import (
45904590
get_container_storage_extension_installed
45914591
)
45924592
try:
@@ -4604,7 +4604,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
46044604
f"extension is installed on the cluster: {str(ex)}"
46054605
) from ex
46064606

4607-
from azure.cli.command_modules.acs.azurecontainerstorage._consts import (
4607+
from azext_aks_preview.azurecontainerstorage._consts import (
46084608
CONST_ACSTOR_IO_ENGINE_LABEL_KEY,
46094609
CONST_ACSTOR_IO_ENGINE_LABEL_VAL
46104610
)
@@ -4640,7 +4640,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
46404640
elif len(agentpool_details) == 1:
46414641
nodepool_list = ','.join(agentpool_details.keys())
46424642

4643-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
4643+
from azext_aks_preview.azurecontainerstorage._validators import (
46444644
validate_enable_azure_container_storage_v1_params
46454645
)
46464646
validate_enable_azure_container_storage_v1_params(
@@ -4719,7 +4719,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
47194719
self.context.set_intermediate("enable_azure_container_storage", True, overwrite_exists=True)
47204720

47214721
if disable_azure_container_storage:
4722-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
4722+
from azext_aks_preview.azurecontainerstorage._validators import (
47234723
validate_disable_azure_container_storage_params_v1
47244724
)
47254725
validate_disable_azure_container_storage_params_v1(
@@ -4758,7 +4758,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
47584758
" before disabling Azure Container Storage?"
47594759
)
47604760

4761-
from azure.cli.command_modules.acs.azurecontainerstorage._consts import (
4761+
from azext_aks_preview.azurecontainerstorage._consts import (
47624762
CONST_ACSTOR_ALL,
47634763
)
47644764
if disable_pool_type != CONST_ACSTOR_ALL:
@@ -4780,13 +4780,14 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
47804780
overwrite_exists=True
47814781
)
47824782

4783-
# Set intermediates
4784-
self.context.set_intermediate("disable_azure_container_storage", True, overwrite_exists=True)
4785-
self.context.set_intermediate(
4786-
"container_storage_version",
4787-
CONST_ACSTOR_VERSION_V1,
4788-
overwrite_exists=True
4789-
)
4783+
# Set intermediates
4784+
self.context.set_intermediate("disable_azure_container_storage", True, overwrite_exists=True)
4785+
self.context.set_intermediate(
4786+
"container_storage_version",
4787+
CONST_ACSTOR_VERSION_V1,
4788+
overwrite_exists=True
4789+
)
4790+
47904791
self.context.set_intermediate("is_extension_installed", is_extension_installed, overwrite_exists=True)
47914792
self.context.set_intermediate("is_azureDisk_enabled", is_azureDisk_enabled, overwrite_exists=True)
47924793
self.context.set_intermediate("is_elasticSan_enabled", is_elasticSan_enabled, overwrite_exists=True)
@@ -4824,7 +4825,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
48244825
'and --disable-azure-container-storage together.'
48254826
)
48264827

4827-
from azure.cli.command_modules.acs.azurecontainerstorage._helpers import (
4828+
from azext_aks_preview.azurecontainerstorage._helpers import (
48284829
get_container_storage_extension_installed
48294830
)
48304831
is_extension_installed, _ = get_container_storage_extension_installed(
@@ -4834,7 +4835,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
48344835
CONST_ACSTOR_EXT_INSTALLATION_NAME,
48354836
)
48364837

4837-
from azure.cli.command_modules.acs.azurecontainerstorage._helpers import (
4838+
from azext_aks_preview.azurecontainerstorage._helpers import (
48384839
get_container_storage_extension_installed
48394840
)
48404841
try:
@@ -4851,7 +4852,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
48514852
) from ex
48524853

48534854
if enable_azure_container_storage_param:
4854-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
4855+
from azext_aks_preview.azurecontainerstorage._validators import (
48554856
validate_enable_azure_container_storage_params,
48564857
)
48574858
validate_enable_azure_container_storage_params(
@@ -4889,7 +4890,7 @@ def update_azure_container_storage(self, mc: ManagedCluster) -> ManagedCluster:
48894890
pre_disable_validate = True
48904891
raise DecoratorEarlyExitException()
48914892

4892-
from azure.cli.command_modules.acs.azurecontainerstorage._validators import (
4893+
from azext_aks_preview.azurecontainerstorage._validators import (
48934894
validate_disable_azure_container_storage_params
48944895
)
48954896
validate_disable_azure_container_storage_params(

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12392,8 +12392,7 @@ def test_aks_update_with_azurecontainerstorage_v1(self, resource_group, resource
1239212392

1239312393
self.cmd(update_cmd, checks=[
1239412394
self.check('provisioningState', 'Succeeded'),
12395-
])
12396-
12395+
])
1239712396
# Sleep for 10 mins before next operation,
1239812397
# since azure container storage operations take
1239912398
# some time to post process.
@@ -12446,8 +12445,7 @@ def test_aks_update_with_azurecontainerstorage_v1_with_ephemeral_disk_parameters
1244612445

1244712446
self.cmd(update_cmd, checks=[
1244812447
self.check('provisioningState', 'Succeeded'),
12449-
])
12450-
12448+
])
1245112449
# Sleep for 10 mins before next operation,
1245212450
# since azure container storage operations take
1245312451
# some time to post process.

0 commit comments

Comments
 (0)