diff --git a/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py b/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py index 56e9026608e..c11666ff341 100644 --- a/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py +++ b/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py @@ -13,10 +13,12 @@ ) from azure.cli.command_modules.acs._helpers import ( check_is_msi_cluster, - safe_list_get, + format_parameter_name_to_option_name, safe_lower, ) -from azure.cli.command_modules.acs._validators import extract_comma_separated_string +from azure.cli.command_modules.acs._validators import ( + extract_comma_separated_string, +) from azure.cli.command_modules.acs.managed_cluster_decorator import ( AKSManagedClusterContext, AKSManagedClusterCreateDecorator, @@ -26,6 +28,7 @@ ) from azure.cli.core import AzCommandsLoader from azure.cli.core.azclierror import ( + ArgumentUsageError, InvalidArgumentValueError, MutuallyExclusiveArgumentError, RequiredArgumentMissingError, @@ -39,7 +42,9 @@ from azext_aks_preview._helpers import get_cluster_snapshot_by_snapshot_id from azext_aks_preview._loadbalancer import create_load_balancer_profile -from azext_aks_preview._loadbalancer import update_load_balancer_profile as _update_load_balancer_profile +from azext_aks_preview._loadbalancer import ( + update_load_balancer_profile as _update_load_balancer_profile, +) from azext_aks_preview._podidentity import ( _fill_defaults_for_pod_identity_profile, _is_pod_identity_addon_enabled, @@ -816,13 +821,15 @@ def get_kubernetes_version(self) -> str: return self._get_kubernetes_version(read_only=False) def get_disk_driver(self) -> Optional[ManagedClusterStorageProfileDiskCSIDriver]: - """Obtrain the value of storage_profile.disk_csi_driver + """Obtain the value of storage_profile.disk_csi_driver :return: Optional[ManagedClusterStorageProfileDiskCSIDriver] """ enable_disk_driver = self.raw_param.get("enable_disk_driver") disable_disk_driver = self.raw_param.get("disable_disk_driver") - if not enable_disk_driver and not disable_disk_driver: + disk_driver_version = self.raw_param.get("disk_driver_version") + + if not enable_disk_driver and not disable_disk_driver and not disk_driver_version: return None profile = self.models.ManagedClusterStorageProfileDiskCSIDriver() @@ -832,25 +839,45 @@ def get_disk_driver(self) -> Optional[ManagedClusterStorageProfileDiskCSIDriver] "--disable-disk-driver at the same time." ) + if disable_disk_driver and disk_driver_version: + raise ArgumentUsageError( + "The parameter --disable-disk-driver cannot be used " + "when --disk-driver-version is specified.") + + if self.decorator_mode == DecoratorMode.UPDATE and disk_driver_version and not enable_disk_driver: + raise ArgumentUsageError( + "Parameter --enable-disk-driver is required " + "when --disk-driver-version is specified during update.") + if self.decorator_mode == DecoratorMode.CREATE: if disable_disk_driver: profile.enabled = False + else: + profile.enabled = True + if disk_driver_version: + profile.version = disk_driver_version if self.decorator_mode == DecoratorMode.UPDATE: if enable_disk_driver: profile.enabled = True + if disk_driver_version: + profile.version = disk_driver_version elif disable_disk_driver: + msg = "Please make sure there are no existing PVs and PVCs that are used by AzureDisk CSI driver before disabling." + if not self.get_yes() and not prompt_y_n(msg, default="n"): + raise DecoratorEarlyExitException() profile.enabled = False return profile def get_file_driver(self) -> Optional[ManagedClusterStorageProfileFileCSIDriver]: - """Obtrain the value of storage_profile.file_csi_driver + """Obtain the value of storage_profile.file_csi_driver :return: Optional[ManagedClusterStorageProfileFileCSIDriver] """ enable_file_driver = self.raw_param.get("enable_file_driver") disable_file_driver = self.raw_param.get("disable_file_driver") + if not enable_file_driver and not disable_file_driver: return None profile = self.models.ManagedClusterStorageProfileFileCSIDriver() @@ -869,19 +896,24 @@ def get_file_driver(self) -> Optional[ManagedClusterStorageProfileFileCSIDriver] if enable_file_driver: profile.enabled = True elif disable_file_driver: + msg = "Please make sure there are no existing PVs and PVCs that are used by AzureFile CSI driver before disabling." + if not self.get_yes() and not prompt_y_n(msg, default="n"): + raise DecoratorEarlyExitException() profile.enabled = False return profile def get_snapshot_controller(self) -> Optional[ManagedClusterStorageProfileSnapshotController]: - """Obtrain the value of storage_profile.snapshot_controller + """Obtain the value of storage_profile.snapshot_controller :return: Optional[ManagedClusterStorageProfileSnapshotController] """ enable_snapshot_controller = self.raw_param.get("enable_snapshot_controller") disable_snapshot_controller = self.raw_param.get("disable_snapshot_controller") + if not enable_snapshot_controller and not disable_snapshot_controller: return None + profile = self.models.ManagedClusterStorageProfileSnapshotController() if enable_snapshot_controller and disable_snapshot_controller: @@ -898,12 +930,16 @@ def get_snapshot_controller(self) -> Optional[ManagedClusterStorageProfileSnapsh if enable_snapshot_controller: profile.enabled = True elif disable_snapshot_controller: + msg = "Please make sure there are no existing VolumeSnapshots, VolumeSnapshotClasses and VolumeSnapshotContents " \ + "that are used by the snapshot controller before disabling." + if not self.get_yes() and not prompt_y_n(msg, default="n"): + raise DecoratorEarlyExitException() profile.enabled = False return profile def get_storage_profile(self) -> Optional[ManagedClusterStorageProfile]: - """Obtrain the value of storage_profile. + """Obtain the value of storage_profile. :return: Optional[ManagedClusterStorageProfile] """ @@ -1040,6 +1076,76 @@ def get_dns_zone_resource_id(self) -> Union[str, None]: # this parameter does not need validation return dns_zone_resource_id + def _get_enable_keda(self, enable_validation: bool = False) -> bool: + """Internal function to obtain the value of enable_keda. + + This function supports the option of enable_validation. When enabled, if both enable_keda and disable_keda are + specified, raise a MutuallyExclusiveArgumentError. + + :return: bool + """ + # Read the original value passed by the command. + enable_keda = self.raw_param.get("enable_keda") + + # In create mode, try to read the property value corresponding to the parameter from the `mc` object. + if self.decorator_mode == DecoratorMode.CREATE: + if ( + self.mc and + self.mc.workload_auto_scaler_profile and + self.mc.workload_auto_scaler_profile.keda + ): + enable_keda = self.mc.workload_auto_scaler_profile.keda.enabled + + # This parameter does not need dynamic completion. + if enable_validation: + if enable_keda and self._get_disable_keda(enable_validation=False): + raise MutuallyExclusiveArgumentError( + "Cannot specify --enable-keda and --disable-keda at the same time." + ) + + return enable_keda + + def get_enable_keda(self) -> bool: + """Obtain the value of enable_keda. + + This function will verify the parameter by default. If both enable_keda and disable_keda are specified, raise a + MutuallyExclusiveArgumentError. + + :return: bool + """ + return self._get_enable_keda(enable_validation=True) + + def _get_disable_keda(self, enable_validation: bool = False) -> bool: + """Internal function to obtain the value of disable_keda. + + This function supports the option of enable_validation. When enabled, if both enable_keda and disable_keda are + specified, raise a MutuallyExclusiveArgumentError. + + :return: bool + """ + # Read the original value passed by the command. + disable_keda = self.raw_param.get("disable_keda") + + # This option is not supported in create mode, hence we do not read the property value from the `mc` object. + # This parameter does not need dynamic completion. + if enable_validation: + if disable_keda and self._get_enable_keda(enable_validation=False): + raise MutuallyExclusiveArgumentError( + "Cannot specify --enable-keda and --disable-keda at the same time." + ) + + return disable_keda + + def get_disable_keda(self) -> bool: + """Obtain the value of disable_keda. + + This function will verify the parameter by default. If both enable_keda and disable_keda are specified, raise a + MutuallyExclusiveArgumentError. + + :return: bool + """ + return self._get_disable_keda(enable_validation=True) + class AKSPreviewManagedClusterCreateDecorator(AKSManagedClusterCreateDecorator): def __init__( @@ -1282,6 +1388,8 @@ def set_up_storage_profile(self, mc: ManagedCluster) -> ManagedCluster: :return: the ManagedCluster object """ + self._ensure_mc(mc) + mc.storage_profile = self.context.get_storage_profile() return mc @@ -1291,6 +1399,8 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster: :return: the ManagedCluster object """ + self._ensure_mc(mc) + addons = self.context.get_enable_addons() if "web_application_routing" in addons: if mc.ingress_profile is None: @@ -1302,6 +1412,20 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster: ) return mc + def set_up_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster: + """Set up workload auto-scaler profile for the ManagedCluster object. + + :return: the ManagedCluster object + """ + self._ensure_mc(mc) + + if self.context.get_enable_keda(): + if mc.workload_auto_scaler_profile is None: + mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile() + mc.workload_auto_scaler_profile.keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=True) + + return mc + def construct_mc_profile_preview(self, bypass_restore_defaults: bool = False) -> ManagedCluster: """The overall controller used to construct the default ManagedCluster profile. @@ -1336,6 +1460,8 @@ def construct_mc_profile_preview(self, bypass_restore_defaults: bool = False) -> mc = self.set_up_storage_profile(mc) # set up ingress web app routing profile mc = self.set_up_ingress_web_app_routing(mc) + # set up workload auto scaler profile + mc = self.set_up_workload_auto_scaler_profile(mc) # DO NOT MOVE: keep this at the bottom, restore defaults mc = self._restore_defaults_in_mc(mc) @@ -1407,66 +1533,15 @@ def check_raw_parameters(self): reconcilePrompt = 'no argument specified to update would you like to reconcile to current settings?' if not prompt_y_n(reconcilePrompt, default="n"): # Note: Uncomment the followings to automatically generate the error message. - # option_names = [ - # '"{}"'.format(format_parameter_name_to_option_name(x)) - # for x in self.context.raw_param.keys() - # if x not in excluded_keys - # ] - # error_msg = "Please specify one or more of {}.".format( - # " or ".join(option_names) - # ) - # raise RequiredArgumentMissingError(error_msg) - raise RequiredArgumentMissingError( - 'Please specify "--enable-cluster-autoscaler" or ' - '"--disable-cluster-autoscaler" or ' - '"--update-cluster-autoscaler" or ' - '"--cluster-autoscaler-profile" or ' - '"--enable-pod-security-policy" or ' - '"--disable-pod-security-policy" or ' - '"--api-server-authorized-ip-ranges" or ' - '"--attach-acr" or ' - '"--detach-acr" or ' - '"--uptime-sla" or ' - '"--no-uptime-sla" or ' - '"--load-balancer-managed-outbound-ip-count" or ' - '"--load-balancer-outbound-ips" or ' - '"--load-balancer-outbound-ip-prefixes" or ' - '"--nat-gateway-managed-outbound-ip-count" or ' - '"--nat-gateway-idle-timeout" or ' - '"--enable-aad" or ' - '"--aad-tenant-id" or ' - '"--aad-admin-group-object-ids" or ' - '"--enable-ahub" or ' - '"--disable-ahub" or ' - '"--enable-managed-identity" or ' - '"--enable-pod-identity" or ' - '"--disable-pod-identity" or ' - '"--auto-upgrade-channel" or ' - '"--enable-secret-rotation" or ' - '"--disable-secret-rotation" or ' - '"--rotation-poll-interval" or ' - '"--tags" or ' - '"--windows-admin-password" or ' - '"--enable-azure-rbac" or ' - '"--disable-azure-rbac" or ' - '"--enable-local-accounts" or ' - '"--disable-local-accounts" or ' - '"--enable-public-fqdn" or ' - '"--disable-public-fqdn"' - '"--enble-windows-gmsa" or ' - '"--nodepool-labels" or ' - '"--enable-oidc-issuer" or ' - '"--http-proxy-config" or ' - '"--enable-disk-driver" or ' - '"--disable-disk-driver" or ' - '"--enable-file-driver" or ' - '"--disable-file-driver" or ' - '"--enable-snapshot-controller" or ' - '"--disable-snapshot-controller" or ' - '"--enable-azure-keyvault-kms" or ' - '"--enable-workload-identity" or ' - '"--disable-workload-identity".' + option_names = [ + '"{}"'.format(format_parameter_name_to_option_name(x)) + for x in self.context.raw_param.keys() + if x not in excluded_keys + ] + error_msg = "Please specify one or more of {}.".format( + " or ".join(option_names) ) + raise RequiredArgumentMissingError(error_msg) def update_load_balancer_profile(self, mc: ManagedCluster) -> ManagedCluster: """Update load balancer profile for the ManagedCluster object. @@ -1624,6 +1699,25 @@ def update_storage_profile(self, mc: ManagedCluster) -> ManagedCluster: return mc + def update_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster: + """Update workload auto-scaler profile for the ManagedCluster object. + + :return: the ManagedCluster object + """ + self._ensure_mc(mc) + + if self.context.get_enable_keda(): + if mc.workload_auto_scaler_profile is None: + mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile() + mc.workload_auto_scaler_profile.keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=True) + + if self.context.get_disable_keda(): + if mc.workload_auto_scaler_profile is None: + mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile() + mc.workload_auto_scaler_profile.keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=False) + + return mc + def update_mc_profile_preview(self) -> ManagedCluster: """The overall controller used to update the preview ManagedCluster profile. @@ -1653,5 +1747,7 @@ def update_mc_profile_preview(self) -> ManagedCluster: mc = self.update_azure_keyvault_kms(mc) # update stroage profile mc = self.update_storage_profile(mc) + # update workload auto scaler profile + mc = self.update_workload_auto_scaler_profile(mc) return mc diff --git a/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_availability_zones.yaml b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_availability_zones.yaml index 6b18c383315..e3f117720dc 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_availability_zones.yaml +++ b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_availability_zones.yaml @@ -13,21 +13,21 @@ interactions: ParameterSetName: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001","name":"clitest000001","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"product":"azurecli","cause":"automation","date":"2022-06-10T05:51:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001","name":"clitest000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2022-06-13T09:59:41Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '305' + - '304' content-type: - application/json; charset=utf-8 date: - - Fri, 10 Jun 2022 05:51:34 GMT + - Mon, 13 Jun 2022 09:59:42 GMT expires: - '-1' pragma: @@ -42,15 +42,15 @@ interactions: code: 200 message: OK - request: - body: '{"location": "westus2", "identity": {"type": "SystemAssigned"}, "properties": - {"kubernetesVersion": "", "dnsPrefix": "cliakstest-clitestqcyzp3rcj-79a739", + body: '{"location": "eastus", "identity": {"type": "SystemAssigned"}, "properties": + {"kubernetesVersion": "", "dnsPrefix": "cliakstest-clitestyd3tllw6w-79a739", "agentPoolProfiles": [{"count": 1, "vmSize": "Standard_DS2_v2", "workloadRuntime": "OCIContainer", "osType": "Linux", "enableAutoScaling": false, "type": "VirtualMachineScaleSets", "mode": "System", "availabilityZones": ["1", "2", "3"], "enableNodePublicIP": false, "enableCustomCATrust": false, "scaleSetPriority": "Regular", "scaleSetEvictionPolicy": "Delete", "spotMaxPrice": -1.0, "enableEncryptionAtHost": false, "enableUltraSSD": false, "enableFIPS": false, "name": "nodepool1"}], "linuxProfile": {"adminUsername": - "azureuser", "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCgQ77GuZfOQLfIWvJSOz2VP21w0pkg5v7UdnUFP5fIoiTnRmPiMKarrr2oVdTdbAzkEd1xtnywxXqMvMSRXRTroO/kmnWte6pOXmkwj5oUIkBExKrF1uwyL7k+une5b8+lELuBtHTe0wJ5QyNCseAW+zNmMu2Z7JQVLxrarTWG4xBBx1ihSF94Qq6dNHy3pvar2XzphOAcVlBjXhe1MCOp+/xa1p6EmmOUYzxMtE//rAojz1kPsW+A5awD9NGgZCPfkvfGYmrbdF//KVHDsODZ7xutiUwGBPyveB+W16iaDABIdZByxrpUhLPYCRbe4P+K9tFKKyIjCYeYHqX4pHCB + "azureuser", "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCykhOqba7guoGsYaVtB4tTn7ewYYYq3cF6yiW3xpqlrJEiRK3VQVtYO1MdJ0HudOOzuCJL1L3FeadX9c6ZviQ25MrX+8PS5/TuklXf+jPahPc9vzN+zD50eLBEr/rHBwQaL5q1sSlhWCZxd2uRQODZVRsnMezmRV+MTysQKTyqjiAVAHeXDYmgE6YmwhdOr93Fda3cHNYTUYKUCD4x8A+QjntXAK9/EQhxdq5+XthsibP3/r6OlkHnYJkORyuAwj3JpOy2dV4cJygPcFlmQpxhJIzb2CZmsg6jvij3I0DsV5B5biD5khViNF7eTChBTwUT7RQ1jJ+ykjHZ6XU0X+5Z azcli_aks_live_test@example.com\n"}]}}, "addonProfiles": {}, "enableRBAC": true, "enablePodSecurityPolicy": false, "networkProfile": {"networkPlugin": "kubenet", "podCidr": "10.244.0.0/16", "serviceCidr": "10.0.0.0/16", "dnsServiceIP": "10.0.0.10", @@ -66,25 +66,25 @@ interactions: Connection: - keep-alive Content-Length: - - '1509' + - '1508' Content-Type: - application/json ParameterSetName: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-05-02-preview response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n - \ \"location\": \"westus2\",\n \"name\": \"cliakstest000002\",\n \"type\": + \ \"location\": \"eastus\",\n \"name\": \"cliakstest000002\",\n \"type\": \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": \"Creating\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": \"1.22.6\",\n \"currentKubernetesVersion\": \"1.22.6\",\n \"dnsPrefix\": - \"cliakstest-clitestqcyzp3rcj-79a739\",\n \"fqdn\": \"cliakstest-clitestqcyzp3rcj-79a739-248ef3b0.hcp.westus2.azmk8s.io\",\n - \ \"azurePortalFQDN\": \"cliakstest-clitestqcyzp3rcj-79a739-248ef3b0.portal.hcp.westus2.azmk8s.io\",\n + \"cliakstest-clitestyd3tllw6w-79a739\",\n \"fqdn\": \"cliakstest-clitestyd3tllw6w-79a739-6cdd49d1.hcp.eastus.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestyd3tllw6w-79a739-6cdd49d1.portal.hcp.eastus.azmk8s.io\",\n \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": 1,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": @@ -96,13 +96,13 @@ interactions: false,\n \"enableCustomCATrust\": false,\n \"mode\": \"System\",\n \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": - \"AKSUbuntu-1804gen2containerd-2022.05.24\",\n \"enableFIPS\": false\n + \"AKSUbuntu-1804gen2containerd-2022.05.31\",\n \"enableFIPS\": false\n \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa - AAAAB3NzaC1yc2EAAAADAQABAAABAQCgQ77GuZfOQLfIWvJSOz2VP21w0pkg5v7UdnUFP5fIoiTnRmPiMKarrr2oVdTdbAzkEd1xtnywxXqMvMSRXRTroO/kmnWte6pOXmkwj5oUIkBExKrF1uwyL7k+une5b8+lELuBtHTe0wJ5QyNCseAW+zNmMu2Z7JQVLxrarTWG4xBBx1ihSF94Qq6dNHy3pvar2XzphOAcVlBjXhe1MCOp+/xa1p6EmmOUYzxMtE//rAojz1kPsW+A5awD9NGgZCPfkvfGYmrbdF//KVHDsODZ7xutiUwGBPyveB+W16iaDABIdZByxrpUhLPYCRbe4P+K9tFKKyIjCYeYHqX4pHCB + AAAAB3NzaC1yc2EAAAADAQABAAABAQCykhOqba7guoGsYaVtB4tTn7ewYYYq3cF6yiW3xpqlrJEiRK3VQVtYO1MdJ0HudOOzuCJL1L3FeadX9c6ZviQ25MrX+8PS5/TuklXf+jPahPc9vzN+zD50eLBEr/rHBwQaL5q1sSlhWCZxd2uRQODZVRsnMezmRV+MTysQKTyqjiAVAHeXDYmgE6YmwhdOr93Fda3cHNYTUYKUCD4x8A+QjntXAK9/EQhxdq5+XthsibP3/r6OlkHnYJkORyuAwj3JpOy2dV4cJygPcFlmQpxhJIzb2CZmsg6jvij3I0DsV5B5biD5khViNF7eTChBTwUT7RQ1jJ+ykjHZ6XU0X+5Z azcli_aks_live_test@example.com\\n\"\n }\n ]\n }\n },\n \"servicePrincipalProfile\": {\n \"clientId\":\"00000000-0000-0000-0000-000000000001\"\n },\n \"nodeResourceGroup\": - \"MC_clitest000001_cliakstest000002_westus2\",\n \"enableRBAC\": true,\n + \"MC_clitest000001_cliakstest000002_eastus\",\n \"enableRBAC\": true,\n \ \"enablePodSecurityPolicy\": false,\n \"networkProfile\": {\n \"networkPlugin\": \"kubenet\",\n \"loadBalancerSku\": \"standard\",\n \"loadBalancerProfile\": {\n \"managedOutboundIPs\": {\n \"count\": 1\n }\n },\n \"podCidr\": @@ -120,15 +120,15 @@ interactions: {\n \"name\": \"Basic\",\n \"tier\": \"Free\"\n }\n }" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 cache-control: - no-cache content-length: - - '3406' + - '3402' content-type: - application/json date: - - Fri, 10 Jun 2022 05:51:39 GMT + - Mon, 13 Jun 2022 09:59:49 GMT expires: - '-1' pragma: @@ -159,13 +159,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -174,7 +174,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:52:09 GMT + - Mon, 13 Jun 2022 10:00:19 GMT expires: - '-1' pragma: @@ -207,13 +207,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -222,7 +222,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:52:39 GMT + - Mon, 13 Jun 2022 10:00:49 GMT expires: - '-1' pragma: @@ -255,13 +255,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -270,7 +270,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:53:09 GMT + - Mon, 13 Jun 2022 10:01:20 GMT expires: - '-1' pragma: @@ -303,13 +303,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -318,7 +318,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:53:39 GMT + - Mon, 13 Jun 2022 10:01:50 GMT expires: - '-1' pragma: @@ -351,13 +351,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -366,7 +366,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:54:10 GMT + - Mon, 13 Jun 2022 10:02:20 GMT expires: - '-1' pragma: @@ -399,13 +399,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -414,7 +414,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:54:40 GMT + - Mon, 13 Jun 2022 10:02:50 GMT expires: - '-1' pragma: @@ -447,13 +447,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:55:10 GMT + - Mon, 13 Jun 2022 10:03:20 GMT expires: - '-1' pragma: @@ -495,13 +495,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -510,7 +510,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:55:40 GMT + - Mon, 13 Jun 2022 10:03:51 GMT expires: - '-1' pragma: @@ -543,13 +543,13 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" headers: cache-control: - no-cache @@ -558,7 +558,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:56:10 GMT + - Mon, 13 Jun 2022 10:04:22 GMT expires: - '-1' pragma: @@ -591,14 +591,302 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/2a40c695-82e8-4538-9a92-3af05f6cfd29?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"95c6402a-e882-3845-9a92-3af05f6cfd29\",\n \"status\": - \"Succeeded\",\n \"startTime\": \"2022-06-10T05:51:39.8566666Z\",\n \"endTime\": - \"2022-06-10T05:56:22.7279461Z\"\n }" + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:04:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:05:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:05:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:06:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:06:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Mon, 13 Jun 2022 10:07:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --node-count --ssh-key-value --zones + User-Agent: + - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d9cc62f5-fb8f-4b76-bfba-7db6c0a810af?api-version=2017-08-31 + response: + body: + string: "{\n \"name\": \"f562ccd9-8ffb-764b-bfba-7db6c0a810af\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2022-06-13T09:59:49.6966666Z\",\n \"endTime\": + \"2022-06-13T10:07:27.7774428Z\"\n }" headers: cache-control: - no-cache @@ -607,7 +895,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:56:40 GMT + - Mon, 13 Jun 2022 10:07:52 GMT expires: - '-1' pragma: @@ -640,18 +928,18 @@ interactions: - --resource-group --name --node-count --ssh-key-value --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-05-02-preview response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n - \ \"location\": \"westus2\",\n \"name\": \"cliakstest000002\",\n \"type\": + \ \"location\": \"eastus\",\n \"name\": \"cliakstest000002\",\n \"type\": \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": \"1.22.6\",\n \"currentKubernetesVersion\": \"1.22.6\",\n \"dnsPrefix\": - \"cliakstest-clitestqcyzp3rcj-79a739\",\n \"fqdn\": \"cliakstest-clitestqcyzp3rcj-79a739-248ef3b0.hcp.westus2.azmk8s.io\",\n - \ \"azurePortalFQDN\": \"cliakstest-clitestqcyzp3rcj-79a739-248ef3b0.portal.hcp.westus2.azmk8s.io\",\n + \"cliakstest-clitestyd3tllw6w-79a739\",\n \"fqdn\": \"cliakstest-clitestyd3tllw6w-79a739-6cdd49d1.hcp.eastus.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestyd3tllw6w-79a739-6cdd49d1.portal.hcp.eastus.azmk8s.io\",\n \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": 1,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": @@ -663,24 +951,24 @@ interactions: false,\n \"enableCustomCATrust\": false,\n \"mode\": \"System\",\n \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": - \"AKSUbuntu-1804gen2containerd-2022.05.24\",\n \"enableFIPS\": false\n + \"AKSUbuntu-1804gen2containerd-2022.05.31\",\n \"enableFIPS\": false\n \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa - AAAAB3NzaC1yc2EAAAADAQABAAABAQCgQ77GuZfOQLfIWvJSOz2VP21w0pkg5v7UdnUFP5fIoiTnRmPiMKarrr2oVdTdbAzkEd1xtnywxXqMvMSRXRTroO/kmnWte6pOXmkwj5oUIkBExKrF1uwyL7k+une5b8+lELuBtHTe0wJ5QyNCseAW+zNmMu2Z7JQVLxrarTWG4xBBx1ihSF94Qq6dNHy3pvar2XzphOAcVlBjXhe1MCOp+/xa1p6EmmOUYzxMtE//rAojz1kPsW+A5awD9NGgZCPfkvfGYmrbdF//KVHDsODZ7xutiUwGBPyveB+W16iaDABIdZByxrpUhLPYCRbe4P+K9tFKKyIjCYeYHqX4pHCB + AAAAB3NzaC1yc2EAAAADAQABAAABAQCykhOqba7guoGsYaVtB4tTn7ewYYYq3cF6yiW3xpqlrJEiRK3VQVtYO1MdJ0HudOOzuCJL1L3FeadX9c6ZviQ25MrX+8PS5/TuklXf+jPahPc9vzN+zD50eLBEr/rHBwQaL5q1sSlhWCZxd2uRQODZVRsnMezmRV+MTysQKTyqjiAVAHeXDYmgE6YmwhdOr93Fda3cHNYTUYKUCD4x8A+QjntXAK9/EQhxdq5+XthsibP3/r6OlkHnYJkORyuAwj3JpOy2dV4cJygPcFlmQpxhJIzb2CZmsg6jvij3I0DsV5B5biD5khViNF7eTChBTwUT7RQ1jJ+ykjHZ6XU0X+5Z azcli_aks_live_test@example.com\\n\"\n }\n ]\n }\n },\n \"servicePrincipalProfile\": {\n \"clientId\":\"00000000-0000-0000-0000-000000000001\"\n },\n \"nodeResourceGroup\": - \"MC_clitest000001_cliakstest000002_westus2\",\n \"enableRBAC\": true,\n + \"MC_clitest000001_cliakstest000002_eastus\",\n \"enableRBAC\": true,\n \ \"enablePodSecurityPolicy\": false,\n \"networkProfile\": {\n \"networkPlugin\": \"kubenet\",\n \"loadBalancerSku\": \"Standard\",\n \"loadBalancerProfile\": {\n \"managedOutboundIPs\": {\n \"count\": 1\n },\n \"effectiveOutboundIPs\": - [\n {\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_clitest000001_cliakstest000002_westus2/providers/Microsoft.Network/publicIPAddresses/a2105978-8d34-4a28-a930-c2a2bbaf52aa\"\n + [\n {\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_clitest000001_cliakstest000002_eastus/providers/Microsoft.Network/publicIPAddresses/4b94efd3-ac7f-4d7c-a106-daab24f0ffdf\"\n \ }\n ]\n },\n \"podCidr\": \"10.244.0.0/16\",\n \"serviceCidr\": \"10.0.0.0/16\",\n \"dnsServiceIP\": \"10.0.0.10\",\n \"dockerBridgeCidr\": \"172.17.0.1/16\",\n \"outboundType\": \"loadBalancer\",\n \"podCidrs\": [\n \"10.244.0.0/16\"\n ],\n \"serviceCidrs\": [\n \"10.0.0.0/16\"\n \ ],\n \"ipFamilies\": [\n \"IPv4\"\n ]\n },\n \"maxAgentPools\": 100,\n \"identityProfile\": {\n \"kubeletidentity\": {\n \"resourceId\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_clitest000001_cliakstest000002_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000002-agentpool\",\n + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_clitest000001_cliakstest000002_eastus/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000002-agentpool\",\n \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n \ }\n },\n \"disableLocalAccounts\": false,\n \"securityProfile\": {},\n \"storageProfile\": {\n \"diskCSIDriver\": {\n \"enabled\": @@ -694,11 +982,11 @@ interactions: cache-control: - no-cache content-length: - - '4059' + - '4053' content-type: - application/json date: - - Fri, 10 Jun 2022 05:56:40 GMT + - Mon, 13 Jun 2022 10:07:53 GMT expires: - '-1' pragma: @@ -731,7 +1019,7 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002/agentPools?api-version=2022-05-02-preview response: @@ -749,7 +1037,7 @@ interactions: false,\n \"enableCustomCATrust\": false,\n \"mode\": \"System\",\n \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": - \"AKSUbuntu-1804gen2containerd-2022.05.24\",\n \"enableFIPS\": false\n + \"AKSUbuntu-1804gen2containerd-2022.05.31\",\n \"enableFIPS\": false\n \ }\n }\n ]\n }" headers: cache-control: @@ -759,7 +1047,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:56:44 GMT + - Mon, 13 Jun 2022 10:07:55 GMT expires: - '-1' pragma: @@ -801,7 +1089,7 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002/agentPools/nodepool2?api-version=2022-05-02-preview response: @@ -817,11 +1105,11 @@ interactions: \"1.22.6\",\n \"currentOrchestratorVersion\": \"1.22.6\",\n \"enableNodePublicIP\": false,\n \"enableCustomCATrust\": false,\n \"mode\": \"User\",\n \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n \"osType\": \"Linux\",\n \"osSKU\": - \"Ubuntu\",\n \"nodeImageVersion\": \"AKSUbuntu-1804gen2containerd-2022.05.24\",\n + \"Ubuntu\",\n \"nodeImageVersion\": \"AKSUbuntu-1804gen2containerd-2022.05.31\",\n \ \"upgradeSettings\": {},\n \"enableFIPS\": false\n }\n }" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 cache-control: - no-cache content-length: @@ -829,7 +1117,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 05:56:47 GMT + - Mon, 13 Jun 2022 10:07:59 GMT expires: - '-1' pragma: @@ -841,7 +1129,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -860,22 +1148,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:57:16 GMT + - Mon, 13 Jun 2022 10:08:29 GMT expires: - '-1' pragma: @@ -908,22 +1196,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:57:47 GMT + - Mon, 13 Jun 2022 10:08:59 GMT expires: - '-1' pragma: @@ -956,22 +1244,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:58:16 GMT + - Mon, 13 Jun 2022 10:09:29 GMT expires: - '-1' pragma: @@ -1004,22 +1292,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:58:47 GMT + - Mon, 13 Jun 2022 10:09:59 GMT expires: - '-1' pragma: @@ -1052,22 +1340,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:59:17 GMT + - Mon, 13 Jun 2022 10:10:29 GMT expires: - '-1' pragma: @@ -1100,22 +1388,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 05:59:47 GMT + - Mon, 13 Jun 2022 10:11:00 GMT expires: - '-1' pragma: @@ -1148,22 +1436,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 06:00:17 GMT + - Mon, 13 Jun 2022 10:11:29 GMT expires: - '-1' pragma: @@ -1196,22 +1484,22 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"InProgress\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\"\n }" headers: cache-control: - no-cache content-length: - - '121' + - '126' content-type: - application/json date: - - Fri, 10 Jun 2022 06:00:47 GMT + - Mon, 13 Jun 2022 10:12:00 GMT expires: - '-1' pragma: @@ -1244,23 +1532,23 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/f7612e32-bfc7-48f3-932e-6f36a0606f55?api-version=2016-03-30 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/d3c2e079-a84c-4c15-89d7-cb30eff2a61e?api-version=2017-08-31 response: body: - string: "{\n \"name\": \"322e61f7-c7bf-f348-932e-6f36a0606f55\",\n \"status\": - \"Succeeded\",\n \"startTime\": \"2022-06-10T05:56:47.33Z\",\n \"endTime\": - \"2022-06-10T06:01:08.5832009Z\"\n }" + string: "{\n \"name\": \"79e0c2d3-4ca8-154c-89d7-cb30eff2a61e\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2022-06-13T10:07:59.1533333Z\",\n \"endTime\": + \"2022-06-13T10:12:19.8612566Z\"\n }" headers: cache-control: - no-cache content-length: - - '165' + - '170' content-type: - application/json date: - - Fri, 10 Jun 2022 06:01:17 GMT + - Mon, 13 Jun 2022 10:12:30 GMT expires: - '-1' pragma: @@ -1293,7 +1581,7 @@ interactions: - --resource-group --cluster-name --name --node-count --zones User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002/agentPools/nodepool2?api-version=2022-05-02-preview response: @@ -1309,7 +1597,7 @@ interactions: \"1.22.6\",\n \"currentOrchestratorVersion\": \"1.22.6\",\n \"enableNodePublicIP\": false,\n \"enableCustomCATrust\": false,\n \"mode\": \"User\",\n \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n \"osType\": \"Linux\",\n \"osSKU\": - \"Ubuntu\",\n \"nodeImageVersion\": \"AKSUbuntu-1804gen2containerd-2022.05.24\",\n + \"Ubuntu\",\n \"nodeImageVersion\": \"AKSUbuntu-1804gen2containerd-2022.05.31\",\n \ \"upgradeSettings\": {},\n \"enableFIPS\": false\n }\n }" headers: cache-control: @@ -1319,7 +1607,7 @@ interactions: content-type: - application/json date: - - Fri, 10 Jun 2022 06:01:18 GMT + - Mon, 13 Jun 2022 10:12:30 GMT expires: - '-1' pragma: @@ -1354,7 +1642,7 @@ interactions: - -g -n --yes --no-wait User-Agent: - AZURECLI/2.37.0 azsdk-python-azure-mgmt-containerservice/19.1.0b Python/3.8.10 - (Linux-5.13.0-1025-azure-x86_64-with-glibc2.29) + (Linux-5.13.0-1029-azure-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-05-02-preview response: @@ -1362,17 +1650,17 @@ interactions: string: '' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/cb062e61-5007-47b8-855a-13193415bb3c?api-version=2016-03-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operations/fe9f09c8-f4b5-4623-a403-69a55ae9ee23?api-version=2017-08-31 cache-control: - no-cache content-length: - '0' date: - - Fri, 10 Jun 2022 06:01:19 GMT + - Mon, 13 Jun 2022 10:12:33 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operationresults/cb062e61-5007-47b8-855a-13193415bb3c?api-version=2016-03-30 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operationresults/fe9f09c8-f4b5-4623-a403-69a55ae9ee23?api-version=2017-08-31 pragma: - no-cache server: diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py index aaf96974e6e..ccc4b07b80e 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py @@ -4594,7 +4594,7 @@ def test_aks_kollect(self, resource_group, resource_group_location): raise CliTestError(f"Output from 'kubectl get daemonset' did not contain '{pattern}'. Output:\n{k_get_daemonset_output}") @AllowLargeResponse() - @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2') + @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus', preserve_default_location=True) def test_aks_availability_zones(self, resource_group, resource_group_location): # kwargs for string formatting aks_name = self.create_random_name('cliakstest', 16) diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py index ac16adb670b..66bcc7bd37a 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py @@ -17,6 +17,7 @@ CONST_CONFCOM_ADDON_NAME, CONST_DEFAULT_NODE_OS_TYPE, CONST_DEFAULT_NODE_VM_SIZE, + CONST_DISK_DRIVER_V2, CONST_GITOPS_ADDON_NAME, CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME, CONST_INGRESS_APPGW_ADDON_NAME, @@ -47,12 +48,21 @@ AKSPreviewManagedClusterUpdateDecorator, ) from azext_aks_preview.tests.latest.utils import get_test_data_file_path -from azure.cli.command_modules.acs._consts import AgentPoolDecoratorMode, DecoratorEarlyExitException, DecoratorMode -from azure.cli.command_modules.acs.managed_cluster_decorator import AKSManagedClusterParamDict -from azure.cli.command_modules.acs.tests.latest.mocks import MockCLI, MockClient, MockCmd +from azure.cli.command_modules.acs._consts import ( + AgentPoolDecoratorMode, + DecoratorEarlyExitException, + DecoratorMode, +) +from azure.cli.command_modules.acs.managed_cluster_decorator import ( + AKSManagedClusterParamDict, +) +from azure.cli.command_modules.acs.tests.latest.mocks import ( + MockCLI, + MockClient, + MockCmd, +) from azure.cli.core.azclierror import ( - AzCLIError, - AzureInternalError, + ArgumentUsageError, CLIInternalError, InvalidArgumentValueError, MutuallyExclusiveArgumentError, @@ -1226,6 +1236,119 @@ def test_get_disk_driver(self): with self.assertRaises(MutuallyExclusiveArgumentError): ctx_1.get_disk_driver() + ctx_2 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict( + { + "enable_disk_driver": True, + "disk_driver_version": "v2", + "disable_disk_driver": False, + } + ), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + storage_profile_2 = self.models.ManagedClusterStorageProfile( + disk_csi_driver=self.models.ManagedClusterStorageProfileDiskCSIDriver( + enabled=False, + version=None, + ), + file_csi_driver=None, + snapshot_controller=None, + ) + mc_2 = self.models.ManagedCluster( + location="test_location", + storage_profile=storage_profile_2, + ) + ctx_2.attach_mc(mc_2) + ground_truth_disk_csi_driver_2 = ( + self.models.ManagedClusterStorageProfileDiskCSIDriver( + enabled=True, + version="v2", + ) + ) + self.assertEqual( + ctx_2.get_disk_driver(), ground_truth_disk_csi_driver_2 + ) + + # fail with enable-disk-driver as false and value passed for disk_driver_version + ctx_3 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disable_disk_driver": True, + "disk_driver_version": "v2", + }), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + + # fail on argument usage error + with self.assertRaises(ArgumentUsageError): + ctx_3.get_disk_driver() + + # fail with enable-disk-driver as false and value passed for disk_driver_version + ctx_4 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disk_driver_version": "v2", + }), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + # fail on argument usage error + with self.assertRaises(ArgumentUsageError): + ctx_4.get_disk_driver() + + # fail on prompt_y_n not specified when disabling disk driver + ctx_5 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disable_disk_driver": True, + }), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + with patch( + "azext_aks_preview.managed_cluster_decorator.prompt_y_n", + return_value=False, + ), self.assertRaises(DecoratorEarlyExitException): + ctx_5.get_disk_driver() + + ctx_6 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disable_disk_driver": True, + }), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ground_truth_disk_csi_driver_6 = ( + self.models.ManagedClusterStorageProfileDiskCSIDriver( + enabled=False, + ) + ) + self.assertEqual( + ctx_6.get_disk_driver(), ground_truth_disk_csi_driver_6 + ) + + ctx_7 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disk_driver_version": CONST_DISK_DRIVER_V2, + }), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ground_truth_disk_csi_driver_7 = ( + self.models.ManagedClusterStorageProfileDiskCSIDriver( + enabled=True, + version=CONST_DISK_DRIVER_V2, + ) + ) + self.assertEqual( + ctx_7.get_disk_driver(), ground_truth_disk_csi_driver_7 + ) + def test_get_file_driver(self): ctx_1 = AKSPreviewManagedClusterContext( self.cmd, @@ -1242,6 +1365,21 @@ def test_get_file_driver(self): with self.assertRaises(MutuallyExclusiveArgumentError): ctx_1.get_file_driver() + # fail on prompt_y_n not specified when disabling file driver + ctx_2 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disable_file_driver": True, + }), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + with patch( + "azext_aks_preview.managed_cluster_decorator.prompt_y_n", + return_value=False, + ), self.assertRaises(DecoratorEarlyExitException): + ctx_2.get_file_driver() + def test_get_snapshot_controller(self): ctx_1 = AKSPreviewManagedClusterContext( self.cmd, @@ -1258,6 +1396,21 @@ def test_get_snapshot_controller(self): with self.assertRaises(MutuallyExclusiveArgumentError): ctx_1.get_snapshot_controller() + # fail on prompt_y_n not specified when disabling snapshot controller + ctx_2 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({ + "disable_snapshot_controller": True, + }), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + with patch( + "azext_aks_preview.managed_cluster_decorator.prompt_y_n", + return_value=False, + ), self.assertRaises(DecoratorEarlyExitException): + ctx_2.get_snapshot_controller() + def test_get_storage_profile(self): # create ctx_1 = AKSPreviewManagedClusterContext( @@ -1266,7 +1419,7 @@ def test_get_storage_profile(self): "disable_disk_driver": True, }), self.models, - decorator_mode=DecoratorMode.UPDATE, + decorator_mode=DecoratorMode.CREATE, ) mc_1 = self.models.ManagedCluster( location="test_location", @@ -1287,6 +1440,7 @@ def test_get_storage_profile(self): AKSManagedClusterParamDict({ "enable_file_driver": True, "disable_snapshot_controller": True, + "yes": True, }), self.models, decorator_mode=DecoratorMode.UPDATE, @@ -1511,6 +1665,174 @@ def test_get_dns_zone_resource_id(self): ctx_1.attach_mc(mc_1) self.assertEqual(ctx_1.get_dns_zone_resource_id(), "test_mc_dns_zone_resource_id") + def test_get_enable_keda(self): + # Returns the value of enable_keda if keda is None in existing profile. + ctx_1 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertIsNone(ctx_1.get_enable_keda()) + + ctx_2 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"enable_keda": False}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertFalse(ctx_2.get_enable_keda()) + + ctx_3 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"enable_keda": True}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertTrue(ctx_3.get_enable_keda()) + + keda_none_mc = self.models.ManagedCluster( + location="test_location", + workload_auto_scaler_profile=self.models.ManagedClusterWorkloadAutoScalerProfile(), + ) + + keda_false_mc = self.models.ManagedCluster( + location="test_location", + workload_auto_scaler_profile=self.models.ManagedClusterWorkloadAutoScalerProfile( + keda=self.models.ManagedClusterWorkloadAutoScalerProfileKeda( + enabled=False + ) + ), + ) + + keda_true_mc = self.models.ManagedCluster( + location="test_location", + workload_auto_scaler_profile=self.models.ManagedClusterWorkloadAutoScalerProfile( + keda=self.models.ManagedClusterWorkloadAutoScalerProfileKeda( + enabled=True + ) + ), + ) + + # Returns the value of keda in existing profile if enable_keda is None. + ctx_4 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ctx_4.attach_mc(keda_none_mc) + self.assertIsNone(ctx_4.get_enable_keda()) + + ctx_5 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ctx_5.attach_mc(keda_false_mc) + self.assertFalse(ctx_5.get_enable_keda()) + + ctx_6 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ctx_6.attach_mc(keda_true_mc) + self.assertTrue(ctx_6.get_enable_keda()) + + # Ignores the value of keda in existing profile in update-mode. + ctx_7 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.UPDATE, + ) + ctx_7.attach_mc(keda_true_mc) + self.assertIsNone(ctx_7.get_enable_keda()) + + # Throws exception when both enable_keda and disable_keda are True. + ctx_8 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict( + {"enable_keda": True, "disable_keda": True} + ), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + with self.assertRaises(MutuallyExclusiveArgumentError): + ctx_8.get_enable_keda() + + # Throws exception when disable_keda and the value of keda in existing profile are True. + ctx_9 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"disable_keda": True}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ctx_9.attach_mc(keda_true_mc) + with self.assertRaises(MutuallyExclusiveArgumentError): + ctx_9.get_enable_keda() + + def test_get_disable_keda(self): + # Returns the value of disable_keda. + ctx_1 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertIsNone(ctx_1.get_disable_keda()) + + ctx_2 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"disable_keda": False}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertFalse(ctx_2.get_disable_keda()) + + ctx_3 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"disable_keda": True}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + self.assertTrue(ctx_3.get_disable_keda()) + + # Throws exception when both enable_keda and disable_keda are True. + ctx_4 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict( + {"enable_keda": True, "disable_keda": True} + ), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + with self.assertRaises(MutuallyExclusiveArgumentError): + ctx_4.get_disable_keda() + + keda_true_mc = self.models.ManagedCluster( + location="test_location", + workload_auto_scaler_profile=self.models.ManagedClusterWorkloadAutoScalerProfile( + keda=self.models.ManagedClusterWorkloadAutoScalerProfileKeda( + enabled=True + ) + ), + ) + + # Throws exception when disable_keda and the value of keda in existing profile are True. + ctx_5 = AKSPreviewManagedClusterContext( + self.cmd, + AKSManagedClusterParamDict({"disable_keda": True}), + self.models, + decorator_mode=DecoratorMode.CREATE, + ) + ctx_5.attach_mc(keda_true_mc) + with self.assertRaises(MutuallyExclusiveArgumentError): + ctx_5.get_disable_keda() + class AKSPreviewManagedClusterCreateDecoratorTestCase(unittest.TestCase): def setUp(self): @@ -2094,6 +2416,55 @@ def test_set_up_ingress_web_app_routing(self): ) self.assertEqual(dec_mc_1, ground_truth_mc_1) + def test_set_up_workload_auto_scaler_profile(self): + # Throws exception when incorrect mc object is passed. + dec_1 = AKSPreviewManagedClusterCreateDecorator( + self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW + ) + with self.assertRaisesRegex( + CLIInternalError, + "^Unexpected mc object with type ''\.$", + ): + dec_1.set_up_workload_auto_scaler_profile(None) + + # Sets profile to None without raw parameters. + dec_2 = AKSPreviewManagedClusterCreateDecorator( + self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW + ) + mc_in = self.models.ManagedCluster(location="test_location") + dec_2.context.attach_mc(mc_in) + mc_out = dec_2.set_up_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNone(mc_out.workload_auto_scaler_profile) + + # Sets profile to None if enable_keda is False. + dec_3 = AKSPreviewManagedClusterCreateDecorator( + self.cmd, + self.client, + {"enable_keda": False}, + CUSTOM_MGMT_AKS_PREVIEW, + ) + mc_in = self.models.ManagedCluster(location="test_location") + dec_3.context.attach_mc(mc_in) + mc_out = dec_3.set_up_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNone(mc_out.workload_auto_scaler_profile) + + # Sets profile with keda enabled if enable_keda is True. + dec_4 = AKSPreviewManagedClusterCreateDecorator( + self.cmd, + self.client, + {"enable_keda": True}, + CUSTOM_MGMT_AKS_PREVIEW, + ) + mc_in = self.models.ManagedCluster(location="test_location") + dec_4.context.attach_mc(mc_in) + mc_out = dec_4.set_up_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertTrue(mc_out.workload_auto_scaler_profile.keda.enabled) + def test_construct_mc_profile_preview(self): import inspect @@ -2968,7 +3339,7 @@ def test_update_storage_profile(self): dec_1 = AKSPreviewManagedClusterUpdateDecorator( self.cmd, self.client, - {"disable_disk_driver": True, "disable_file_driver": True, "disable_snapshot_controller": True}, + {"disable_disk_driver": True, "disable_file_driver": True, "disable_snapshot_controller": True, "yes": True}, CUSTOM_MGMT_AKS_PREVIEW, ) storage_profile_1 = self.models.ManagedClusterStorageProfile( @@ -3013,6 +3384,89 @@ def test_update_storage_profile(self): ) self.assertEqual(dec_mc_2, ground_truth_mc_2) + def test_update_workload_auto_scaler_profile(self): + # Throws exception when incorrect mc object is passed. + dec_1 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + with self.assertRaisesRegex(CLIInternalError, "^Unexpected mc object with type ''\.$"): + dec_1.update_workload_auto_scaler_profile(None) + + # Throws exception when the mc object passed does not match the one in context. + dec_2 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + with self.assertRaisesRegex(CLIInternalError, "^Inconsistent state detected\. The incoming `mc` is not the same as the `mc` in the context\.$"): + mc_in = self.models.ManagedCluster(location="test_location") + dec_2.update_workload_auto_scaler_profile(mc_in) + + # Leaves profile as None without raw parameters. + dec_3 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + mc_in = self.models.ManagedCluster(location="test_location") + dec_3.context.attach_mc(mc_in) + mc_out = dec_3.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNone(mc_out.workload_auto_scaler_profile) + + # Leaves existing profile untouched without raw parameters. + dec_4 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + profile = self.models.ManagedClusterWorkloadAutoScalerProfile( + keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=True)) + mc_in = self.models.ManagedCluster(location="test_location", workload_auto_scaler_profile = profile) + dec_4.context.attach_mc(mc_in) + mc_out = dec_4.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertEqual(mc_out.workload_auto_scaler_profile, profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertTrue(mc_out.workload_auto_scaler_profile.keda.enabled) + + # Enables keda when enable_keda is True. + dec_5 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {"enable_keda": True}, CUSTOM_MGMT_AKS_PREVIEW) + mc_in = self.models.ManagedCluster(location="test_location") + dec_5.context.attach_mc(mc_in) + mc_out = dec_5.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertTrue(mc_out.workload_auto_scaler_profile.keda.enabled) + + # Enables keda in existing profile when enable_keda is True. + dec_6 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {"enable_keda": True}, CUSTOM_MGMT_AKS_PREVIEW) + profile = self.models.ManagedClusterWorkloadAutoScalerProfile( + keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=False)) + mc_in = self.models.ManagedCluster(location="test_location", workload_auto_scaler_profile = profile) + dec_6.context.attach_mc(mc_in) + mc_out = dec_6.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertEqual(mc_out.workload_auto_scaler_profile, profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertTrue(mc_out.workload_auto_scaler_profile.keda.enabled) + + # Disables keda when disable_keda is True. + dec_7 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {"disable_keda": True}, CUSTOM_MGMT_AKS_PREVIEW) + mc_in = self.models.ManagedCluster(location="test_location") + dec_7.context.attach_mc(mc_in) + mc_out = dec_7.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertFalse(mc_out.workload_auto_scaler_profile.keda.enabled) + + # Disables keda in existing profile when disable_keda is True. + dec_8 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {"disable_keda": True}, CUSTOM_MGMT_AKS_PREVIEW) + profile = self.models.ManagedClusterWorkloadAutoScalerProfile( + keda = self.models.ManagedClusterWorkloadAutoScalerProfileKeda(enabled=True)) + mc_in = self.models.ManagedCluster(location="test_location", workload_auto_scaler_profile = profile) + dec_8.context.attach_mc(mc_in) + mc_out = dec_8.update_workload_auto_scaler_profile(mc_in) + self.assertEqual(mc_out, mc_in) + self.assertEqual(mc_out.workload_auto_scaler_profile, profile) + self.assertIsNotNone(mc_out.workload_auto_scaler_profile.keda) + self.assertFalse(mc_out.workload_auto_scaler_profile.keda.enabled) + + # Throws exception when both enable_keda and disable_keda are True. + dec_9 = AKSPreviewManagedClusterUpdateDecorator(self.cmd, self.client, {"enable_keda": True, "disable_keda": True}, CUSTOM_MGMT_AKS_PREVIEW) + mc_in = self.models.ManagedCluster(location="test_location") + dec_9.context.attach_mc(mc_in) + with self.assertRaises(MutuallyExclusiveArgumentError): + mc_out = dec_9.update_workload_auto_scaler_profile(mc_in) + def test_update_mc_profile_preview(self): import inspect