diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 1d3d4667e98..47611385f2f 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -2,6 +2,10 @@ Release History =============== +0.5.50 +++++++ +* Add support for enabling OIDC issuer with `--enable-oidc-issuer` flag. + 0.5.49 ++++++ * Add support for Alias Minor Version. diff --git a/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json b/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json index 7e7feec3315..c7db056940b 100644 --- a/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json +++ b/src/aks-preview/azcli_aks_live_test/configs/ext_matrix_default.json @@ -24,7 +24,9 @@ "test_aks_create_with_http_proxy_config", "test_aks_nodepool_add_with_workload_runtime", "test_aks_nodepool_add_with_gpu_instance_profile", - "test_aks_snapshot" + "test_aks_snapshot", + "test_aks_create_with_oidc_issuer_enabled", + "test_aks_update_with_oidc_issuer_enabled" ] } -} +} \ No newline at end of file diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index 0d2f1800d39..080dd932bea 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -395,6 +395,9 @@ - name: --snapshot-id type: string short-summary: The source snapshot id used to create this cluster. + - name: --enable-oidc-issuer + type: bool + short-summary: (PREVIEW) Enable OIDC issuer. examples: - name: Create a Kubernetes cluster with an existing SSH public key. text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey @@ -652,6 +655,9 @@ long-summary: |- You do not need to set this if you have set DNS server in the VNET used by the cluster. You must set or not set --gmsa-dns-server and --gmsa-root-domain-name at the same time when setting --enable-windows-gmsa. + - name: --enable-oidc-issuer + type: bool + short-summary: (PREVIEW) Enable OIDC issuer. examples: - name: Enable cluster-autoscaler within node count range [1,5] text: az aks update --enable-cluster-autoscaler --min-count 1 --max-count 5 -g MyResourceGroup -n MyManagedCluster diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index 281d1de3598..ba34b2abb42 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -159,6 +159,7 @@ def load_arguments(self, _): c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') c.argument('workload_runtime', arg_type=get_enum_type(workload_runtimes), default=CONST_WORKLOAD_RUNTIME_OCI_CONTAINER) c.argument('snapshot_id', type=str, validator=validate_snapshot_id, is_preview=True) + c.argument('enable_oidc_issuer', action='store_true', is_preview=True) with self.argument_context('aks update') as c: c.argument('enable_cluster_autoscaler', options_list=["--enable-cluster-autoscaler", "-e"], action='store_true') @@ -202,6 +203,7 @@ def load_arguments(self, _): c.argument('gmsa_root_domain_name', options_list=['--gmsa-root-domain-name']) c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') c.argument('nodepool_labels', nargs='*', validator=validate_nodepool_labels, help='space-separated labels: key[=value] [key[=value] ...]. See https://aka.ms/node-labels for syntax of labels.') + c.argument('enable_oidc_issuer', action='store_true', is_preview=True) with self.argument_context('aks scale') as c: c.argument('nodepool_name', type=str, diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index 00806dc9930..12b7d4ce54a 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -757,6 +757,7 @@ def aks_create(cmd, gmsa_dns_server=None, gmsa_root_domain_name=None, snapshot_id=None, + enable_oidc_issuer=False, yes=False): # DO NOT MOVE: get all the original parameters and save them as a dictionary raw_parameters = locals() @@ -833,7 +834,8 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches, disable_azure_rbac=False, enable_windows_gmsa=False, gmsa_dns_server=None, - gmsa_root_domain_name=None): + gmsa_root_domain_name=None, + enable_oidc_issuer=False): # DO NOT MOVE: get all the original parameters and save them as a dictionary raw_parameters = locals() diff --git a/src/aks-preview/azext_aks_preview/decorator.py b/src/aks-preview/azext_aks_preview/decorator.py index f2bf39a1f9e..45179401e87 100644 --- a/src/aks-preview/azext_aks_preview/decorator.py +++ b/src/aks-preview/azext_aks_preview/decorator.py @@ -77,6 +77,7 @@ ManagedClusterHTTPProxyConfig = TypeVar("ManagedClusterHTTPProxyConfig") ContainerServiceNetworkProfile = TypeVar("ContainerServiceNetworkProfile") ManagedClusterAddonProfile = TypeVar("ManagedClusterAddonProfile") +ManagedClusterOIDCIssuerProfile = TypeVar('ManagedClusterOIDCIssuerProfile') Snapshot = TypeVar("Snapshot") @@ -114,6 +115,11 @@ def __init__(self, cmd: AzCommandsLoader, resource_type: ResourceType): self.init_nat_gateway_models() # holder for pod identity related models self.__pod_identity_models = None + self.ManagedClusterOIDCIssuerProfile = self.__cmd.get_models( + "ManagedClusterOIDCIssuerProfile", + resource_type=self.resource_type, + operation_group="managed_clusters", + ) # TODO: convert this to @property def init_nat_gateway_models(self) -> None: @@ -1492,6 +1498,24 @@ def get_node_vm_size(self) -> str: """ return self._get_node_vm_size() + def get_oidc_issuer_profile(self) -> ManagedClusterOIDCIssuerProfile: + """Obtain the value of oidc_issuer_profile based on the user input. + + :return: ManagedClusterOIDCIssuerProfile + """ + enable_flag_value = bool(self.raw_param.get("enable_oidc_issuer")) + if not enable_flag_value: + # enable flag not set, return a None profile, server side will backfill the default/existing value + return None + + profile = self.models.ManagedClusterOIDCIssuerProfile() + if self.decorator_mode == DecoratorMode.UPDATE: + if self.mc.oidc_issuer_profile is not None: + profile = self.mc.oidc_issuer_profile + profile.enabled = True + + return profile + class AKSPreviewCreateDecorator(AKSCreateDecorator): # pylint: disable=super-init-not-called @@ -1799,6 +1823,15 @@ def set_up_windows_profile(self, mc: ManagedCluster) -> ManagedCluster: mc.windows_profile = windows_profile return mc + def set_up_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster: + """Set up OIDC issuer profile for the ManagedCluster object. + + :return: the ManagedCluster object + """ + mc.oidc_issuer_profile = self.context.get_oidc_issuer_profile() + + return mc + def construct_mc_preview_profile(self) -> ManagedCluster: """The overall controller used to construct the preview ManagedCluster profile. @@ -1817,6 +1850,7 @@ def construct_mc_preview_profile(self) -> ManagedCluster: mc = self.set_up_pod_security_policy(mc) # set up pod identity profile mc = self.set_up_pod_identity_profile(mc) + mc = self.set_up_oidc_issuer_profile(mc) return mc def create_mc_preview(self, mc: ManagedCluster) -> ManagedCluster: @@ -1963,7 +1997,8 @@ def check_raw_parameters(self): '"--enable-public-fqdn" or ' '"--disable-public-fqdn"' '"--enble-windows-gmsa" or ' - '"--nodepool-labels".' + '"--nodepool-labels" or ' + '"--enable-oidc-issuer".' ) def update_load_balancer_profile(self, mc: ManagedCluster) -> ManagedCluster: @@ -2078,6 +2113,17 @@ def update_pod_identity_profile(self, mc: ManagedCluster) -> ManagedCluster: _update_addon_pod_identity(mc, enable=False, models=self.models.pod_identity_models) return mc + def update_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster: + """Update OIDC issuer profile for the ManagedCluster object. + + :return: the ManagedCluster object + """ + self._ensure_mc(mc) + + mc.oidc_issuer_profile = self.context.get_oidc_issuer_profile() + + return mc + def patch_mc(self, mc: ManagedCluster) -> ManagedCluster: """Helper function to patch the ManagedCluster object. @@ -2109,6 +2155,7 @@ def update_mc_preview_profile(self) -> ManagedCluster: mc = self.update_nat_gateway_profile(mc) # update pod identity profile mc = self.update_pod_identity_profile(mc) + mc = self.update_oidc_issuer_profile(mc) return mc def update_mc_preview(self, mc: ManagedCluster) -> ManagedCluster: diff --git a/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_with_oidc_issuer_enabled.yaml b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_with_oidc_issuer_enabled.yaml new file mode 100644 index 00000000000..12aa593ccfd --- /dev/null +++ b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_create_with_oidc_issuer_enabled.yaml @@ -0,0 +1,630 @@ +interactions: +- request: + body: '{"location": "westus2", "identity": {"type": "SystemAssigned"}, "properties": + {"kubernetesVersion": "", "dnsPrefix": "cliakstest-clitestpgm3k4btu-8ecadf", + "agentPoolProfiles": [{"count": 3, "vmSize": "Standard_DS2_v2", "workloadRuntime": + "OCIContainer", "osType": "Linux", "enableAutoScaling": false, "type": "VirtualMachineScaleSets", + "mode": "System", "enableNodePublicIP": false, "scaleSetPriority": "Regular", + "scaleSetEvictionPolicy": "Delete", "spotMaxPrice": -1.0, "enableEncryptionAtHost": + false, "enableUltraSSD": false, "enableFIPS": false, "name": "nodepool1"}], + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + azcli_aks_live_test@example.com\n"}]}}, "addonProfiles": {}, "oidcIssuerProfile": + {"enabled": true}, "enableRBAC": true, "enablePodSecurityPolicy": false, "networkProfile": + {"networkPlugin": "kubenet", "podCidr": "10.244.0.0/16", "serviceCidr": "10.0.0.0/16", + "dnsServiceIP": "10.0.0.10", "dockerBridgeCidr": "172.17.0.1/16", "outboundType": + "loadBalancer", "loadBalancerSku": "standard"}, "disableLocalAccounts": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + Content-Length: + - '1459' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --name --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Creating\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestpgm3k4btu-8ecadf\",\n \"fqdn\": \"cliakstest-clitestpgm3k4btu-8ecadf-a35931b4.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestpgm3k4btu-8ecadf-a35931b4.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Creating\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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\": + \"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 \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": true,\n \"issuerURL\": \"https://oidc.prod-aks.azure.com/4e2395b8-93e1-4f5b-ac0c-6ef2afa1439d/\"\n + \ }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\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/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + cache-control: + - no-cache + content-length: + - '3113' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:43:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:43:56 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:44:25 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:44:55 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:45:25 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:45:55 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:46:26 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:46:56 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:47:26 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/740eca28-8bdb-496b-b416-3b1d10bc8040?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"28ca0e74-db8b-6b49-b416-3b1d10bc8040\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2021-12-30T13:43:25.8866666Z\",\n \"endTime\": + \"2021-12-30T13:47:37.8827212Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '170' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:47:56 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 --location --enable-managed-identity --enable-oidc-issuer + --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestpgm3k4btu-8ecadf\",\n \"fqdn\": \"cliakstest-clitestpgm3k4btu-8ecadf-a35931b4.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestpgm3k4btu-8ecadf-a35931b4.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Succeeded\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/e2ef095f-d194-4081-afaf-e1c2fd030cab\"\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_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": true,\n \"issuerURL\": \"https://oidc.prod-aks.azure.com/4e2395b8-93e1-4f5b-ac0c-6ef2afa1439d/\"\n + \ }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\n \"name\": \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '3766' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 13:47:56 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 +version: 1 diff --git a/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_update_with_oidc_issuer_enabled.yaml b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_update_with_oidc_issuer_enabled.yaml new file mode 100644 index 00000000000..abdd72b528a --- /dev/null +++ b/src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_update_with_oidc_issuer_enabled.yaml @@ -0,0 +1,954 @@ +interactions: +- request: + body: '{"location": "westus2", "identity": {"type": "SystemAssigned"}, "properties": + {"kubernetesVersion": "", "dnsPrefix": "cliakstest-clitestm4rjkqt4o-8ecadf", + "agentPoolProfiles": [{"count": 3, "vmSize": "Standard_DS2_v2", "workloadRuntime": + "OCIContainer", "osType": "Linux", "enableAutoScaling": false, "type": "VirtualMachineScaleSets", + "mode": "System", "enableNodePublicIP": false, "scaleSetPriority": "Regular", + "scaleSetEvictionPolicy": "Delete", "spotMaxPrice": -1.0, "enableEncryptionAtHost": + false, "enableUltraSSD": false, "enableFIPS": false, "name": "nodepool1"}], + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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", + "dockerBridgeCidr": "172.17.0.1/16", "outboundType": "loadBalancer", "loadBalancerSku": + "standard"}, "disableLocalAccounts": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + Content-Length: + - '1419' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --name --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Creating\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestm4rjkqt4o-8ecadf\",\n \"fqdn\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Creating\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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\": + \"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 \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": false\n }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n + \ \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n \"tenantId\": + \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": {\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/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + cache-control: + - no-cache + content-length: + - '3024' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:06:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:07:20 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:07:50 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:08:20 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:08:50 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:09:20 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:09:50 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/547da14b-9ee7-41df-85a7-65c190b2b105?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"4ba17d54-e79e-df41-85a7-65c190b2b105\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2021-12-30T14:06:50.5566666Z\",\n \"endTime\": + \"2021-12-30T14:09:57.7381708Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '170' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:10:20 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 --location --enable-managed-identity --ssh-key-value + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestm4rjkqt4o-8ecadf\",\n \"fqdn\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Succeeded\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/97450ba2-c4fa-49bf-8af1-381f59363af9\"\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_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": false\n }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n + \ \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n \"tenantId\": + \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": {\n \"name\": + \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '3677' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:10:20 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: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestm4rjkqt4o-8ecadf\",\n \"fqdn\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Succeeded\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/97450ba2-c4fa-49bf-8af1-381f59363af9\"\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_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": false\n }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n + \ \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n \"tenantId\": + \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": {\n \"name\": + \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '3677' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:10:21 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: '{"location": "westus2", "sku": {"name": "Basic", "tier": "Free"}, "identity": + {"type": "SystemAssigned"}, "properties": {"kubernetesVersion": "1.21.7", "dnsPrefix": + "cliakstest-clitestm4rjkqt4o-8ecadf", "agentPoolProfiles": [{"count": 3, "vmSize": + "Standard_DS2_v2", "osDiskSizeGB": 128, "osDiskType": "Managed", "kubeletDiskType": + "OS", "workloadRuntime": "OCIContainer", "maxPods": 110, "osType": "Linux", + "osSKU": "Ubuntu", "enableAutoScaling": false, "type": "VirtualMachineScaleSets", + "mode": "System", "orchestratorVersion": "1.21.7", "powerState": {"code": "Running"}, + "enableNodePublicIP": false, "enableEncryptionAtHost": false, "enableUltraSSD": + false, "enableFIPS": false, "name": "nodepool1"}], "linuxProfile": {"adminUsername": + "azureuser", "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + azcli_aks_live_test@example.com\n"}]}}, "servicePrincipalProfile": {"clientId":"00000000-0000-0000-0000-000000000001"}, + "oidcIssuerProfile": {"enabled": true}, "nodeResourceGroup": "MC_clitest000001_cliakstest000001_westus2", + "enableRBAC": true, "enablePodSecurityPolicy": false, "networkProfile": {"networkPlugin": + "kubenet", "podCidr": "10.244.0.0/16", "serviceCidr": "10.0.0.0/16", "dnsServiceIP": + "10.0.0.10", "dockerBridgeCidr": "172.17.0.1/16", "outboundType": "loadBalancer", + "loadBalancerSku": "Standard", "loadBalancerProfile": {"managedOutboundIPs": + {"count": 1, "countIPv6": 0}, "effectiveOutboundIPs": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_clitest000001_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/97450ba2-c4fa-49bf-8af1-381f59363af9"}]}, + "podCidrs": ["10.244.0.0/16"], "serviceCidrs": ["10.0.0.0/16"], "ipFamilies": + ["IPv4"]}, "identityProfile": {"kubeletidentity": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_clitest000001_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool", + "clientId":"00000000-0000-0000-0000-000000000001", "objectId":"00000000-0000-0000-0000-000000000001"}}, + "disableLocalAccounts": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks update + Connection: + - keep-alive + Content-Length: + - '2467' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Updating\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestm4rjkqt4o-8ecadf\",\n \"fqdn\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Updating\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/97450ba2-c4fa-49bf-8af1-381f59363af9\"\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_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": true,\n \"issuerURL\": \"https://oidc.prod-aks.azure.com/f86defaf-6a4f-4f14-9552-15dbddd38fce/\"\n + \ }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\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/dc250989-5c65-4206-93aa-3be914004d20?api-version=2016-03-30 + cache-control: + - no-cache + content-length: + - '3764' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:10:23 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 + x-ms-ratelimit-remaining-subscription-writes: + - '1190' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/dc250989-5c65-4206-93aa-3be914004d20?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"890925dc-655c-0642-93aa-3be914004d20\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:10:23.6533333Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:10: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 update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/dc250989-5c65-4206-93aa-3be914004d20?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"890925dc-655c-0642-93aa-3be914004d20\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2021-12-30T14:10:23.6533333Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '126' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:11:23 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 update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/dc250989-5c65-4206-93aa-3be914004d20?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"890925dc-655c-0642-93aa-3be914004d20\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2021-12-30T14:10:23.6533333Z\",\n \"endTime\": + \"2021-12-30T14:11:54.0261652Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '170' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:11:53 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 update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --enable-oidc-issuer + User-Agent: + - AZURECLI/2.31.0 azsdk-python-azure-mgmt-containerservice/16.5.0 Python/3.8.11 + (Linux-5.11.0-1022-azure-x86_64-with-glibc2.27) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001?api-version=2021-11-01-preview + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000001\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000001\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.21.7\",\n \"currentKubernetesVersion\": \"1.21.7\",\n \"dnsPrefix\": + \"cliakstest-clitestm4rjkqt4o-8ecadf\",\n \"fqdn\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitestm4rjkqt4o-8ecadf-51fd28b9.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"workloadRuntime\": + \"OCIContainer\",\n \"maxPods\": 110,\n \"type\": \"VirtualMachineScaleSets\",\n + \ \"enableAutoScaling\": false,\n \"provisioningState\": \"Succeeded\",\n + \ \"powerState\": {\n \"code\": \"Running\"\n },\n \"orchestratorVersion\": + \"1.21.7\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2021.12.07\",\n \"enableFIPS\": false\n + \ }\n ],\n \"linuxProfile\": {\n \"adminUsername\": \"azureuser\",\n + \ \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": \"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJx16Xyl5Tj3d0wf53L1yifNnFiXCK/anWwWywvruUSba/rg9Ig2NY+YE+V2jUX74RcJpv0Bw2WrIZHMnglMV6tkkf+qr+4LvzS6xw7v/FmNob3ApZSef8cgHUee5+dK8zZQ/wFKIT1Zsf4TM0dAf1TNcXklaZPZXZbmt2pkJ/ihXpQGxfhkl3KCihSXzZLwXVcsddNkhW6Gx22H4sP5dkjZpprJ8WLzMnu8gnsx/8Vo0nZgmPI+f/ae9OhXTZ+U5KdNr9yAmRucfs0dUsfMAVq1pBaxKdVNlM1CIws2TEmi19BK2m6d3V4iTkNrEE8YSigrr09l/pefcfPAY8ZYn + 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_cliakstest000001_westus2\",\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_cliakstest000001_westus2/providers/Microsoft.Network/publicIPAddresses/97450ba2-c4fa-49bf-8af1-381f59363af9\"\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_cliakstest000001_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000001-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"oidcIssuerProfile\": + {\n \"enabled\": true,\n \"issuerURL\": \"https://oidc.prod-aks.azure.com/f86defaf-6a4f-4f14-9552-15dbddd38fce/\"\n + \ }\n },\n \"identity\": {\n \"type\": \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\n \"name\": \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '3766' + content-type: + - application/json + date: + - Thu, 30 Dec 2021 14:11:54 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 +version: 1 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 bd76f6cdf9b..d1f80e98513 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 @@ -3256,3 +3256,58 @@ def test_aks_update_label_msi(self, resource_group, resource_group_location): self.check('agentPoolProfiles[0].nodeLabels.label1', 'value11'), self.check('agentPoolProfiles[0].nodeLabels.label2', None), ]) + + @AllowLargeResponse() + @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='centraluseuap') + def test_aks_create_with_oidc_issuer_enabled(self, resource_group, resource_group_location): + # reset the count so in replay mode the random names will start with 0 + self.test_resources_count = 0 + # kwargs for string formatting + aks_name = self.create_random_name('cliakstest', 16) + + self.kwargs.update({ + 'resource_group': resource_group, + 'name': aks_name, + 'location': resource_group_location, + 'resource_type': 'Microsoft.ContainerService/ManagedClusters', + 'ssh_key_value': self.generate_ssh_keys(), + }) + + create_cmd = 'aks create --resource-group={resource_group} --name={name} --location={location} ' \ + '--enable-managed-identity ' \ + '--enable-oidc-issuer ' \ + '--ssh-key-value={ssh_key_value}' + self.cmd(create_cmd, checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('oidcIssuerProfile.enabled', True), + ]) + + @AllowLargeResponse() + @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='centraluseuap') + def test_aks_update_with_oidc_issuer_enabled(self, resource_group, resource_group_location): + # reset the count so in replay mode the random names will start with 0 + self.test_resources_count = 0 + # kwargs for string formatting + aks_name = self.create_random_name('cliakstest', 16) + + self.kwargs.update({ + 'resource_group': resource_group, + 'name': aks_name, + 'location': resource_group_location, + 'resource_type': 'Microsoft.ContainerService/ManagedClusters', + 'ssh_key_value': self.generate_ssh_keys(), + }) + + create_cmd = 'aks create --resource-group={resource_group} --name={name} --location={location} ' \ + '--enable-managed-identity ' \ + '--ssh-key-value={ssh_key_value}' + self.cmd(create_cmd, checks=[ + self.check('provisioningState', 'Succeeded'), + ]) + + update_cmd = 'aks update --resource-group={resource_group} --name={name} ' \ + '--enable-oidc-issuer' + self.cmd(update_cmd, checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('oidcIssuerProfile.enabled', True), + ]) \ No newline at end of file diff --git a/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py b/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py index 323f071d702..33bb70308b8 100644 --- a/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py +++ b/src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py @@ -1531,6 +1531,39 @@ def test_test_get_outbound_type(self): load_balancer_profile=load_balancer_profile, ) + def test_get_oidc_issuer_profile__create_not_set(self): + ctx = AKSPreviewContext(self.cmd, {}, self.models, decorator_mode=DecoratorMode.CREATE) + self.assertIsNone(ctx.get_oidc_issuer_profile()) + + def test_get_oidc_issuer_profile__create_enable(self): + ctx = AKSPreviewContext(self.cmd, { + "enable_oidc_issuer": True, + }, self.models, decorator_mode=DecoratorMode.CREATE) + profile = ctx.get_oidc_issuer_profile() + self.assertIsNotNone(profile) + self.assertTrue(profile.enabled) + + def test_get_oidc_issuer_profile__update_not_set(self): + ctx = AKSPreviewContext(self.cmd, {}, self.models, decorator_mode=DecoratorMode.UPDATE) + ctx.attach_mc(self.models.ManagedCluster(location='test_location')) + self.assertIsNone(ctx.get_oidc_issuer_profile()) + + def test_get_oidc_issuer_profile__update_not_set_with_previous_profile(self): + ctx = AKSPreviewContext(self.cmd, {}, self.models, decorator_mode=DecoratorMode.UPDATE) + mc = self.models.ManagedCluster(location='test_location') + mc.oidc_issuer_profile = self.models.ManagedClusterOIDCIssuerProfile(enabled=True, issuer_url='https://issuer-url') + ctx.attach_mc(self.models.ManagedCluster(location='test_location')) + self.assertIsNone(ctx.get_oidc_issuer_profile()) + + def test_get_oidc_issuer_profile__update_enable(self): + ctx = AKSPreviewContext(self.cmd, { + "enable_oidc_issuer": True, + }, self.models, decorator_mode=DecoratorMode.UPDATE) + ctx.attach_mc(self.models.ManagedCluster(location='test_location')) + profile = ctx.get_oidc_issuer_profile() + self.assertIsNotNone(profile) + self.assertTrue(profile.enabled) + class AKSPreviewCreateDecoratorTestCase(unittest.TestCase): def setUp(self): @@ -2385,6 +2418,31 @@ def test_set_up_windows_profile(self): ) self.assertEqual(dec_mc_2, ground_truth_mc_2) + def test_set_up_oidc_issuer_profile__default_value(self): + dec = AKSPreviewCreateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + updated_mc = dec.set_up_oidc_issuer_profile(mc) + self.assertIsNone(updated_mc.oidc_issuer_profile) + + def test_set_up_oidc_issuer_profile__enabled(self): + dec = AKSPreviewCreateDecorator(self.cmd, self.client, { + "enable_oidc_issuer": True, + }, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + updated_mc = dec.set_up_oidc_issuer_profile(mc) + self.assertIsNotNone(updated_mc.oidc_issuer_profile) + self.assertTrue(updated_mc.oidc_issuer_profile.enabled) + + def test_set_up_oidc_issuer_profile__enabled_mc_enabled(self): + dec = AKSPreviewCreateDecorator(self.cmd, self.client, { + "enable_oidc_issuer": True, + }, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + mc.oidc_issuer_profile = self.models.ManagedClusterOIDCIssuerProfile(enabled=True, issuer_url='https://issuer-url') + updated_mc = dec.set_up_oidc_issuer_profile(mc) + self.assertIsNotNone(updated_mc.oidc_issuer_profile) + self.assertTrue(updated_mc.oidc_issuer_profile.enabled) + def test_construct_mc_preview_profile(self): import inspect @@ -3350,6 +3408,42 @@ def test_update_pod_identity_profile(self): ) self.assertEqual(dec_mc_4, ground_truth_mc_4) + def test_update_oidc_issuer_profile__default_value(self): + dec = AKSPreviewUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + dec.context.attach_mc(mc) + updated_mc = dec.update_oidc_issuer_profile(mc) + self.assertIsNone(updated_mc.oidc_issuer_profile) + + def test_update_oidc_issuer_profile__default_value_mc_enabled(self): + dec = AKSPreviewUpdateDecorator(self.cmd, self.client, {}, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + mc.oidc_issuer_profile = self.models.ManagedClusterOIDCIssuerProfile(enabled=True, issuer_url='https://issuer-url') + dec.context.attach_mc(mc) + updated_mc = dec.update_oidc_issuer_profile(mc) + self.assertIsNone(updated_mc.oidc_issuer_profile) + + def test_update_oidc_issuer_profile__enabled(self): + dec = AKSPreviewUpdateDecorator(self.cmd, self.client, { + "enable_oidc_issuer": True, + }, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + dec.context.attach_mc(mc) + updated_mc = dec.update_oidc_issuer_profile(mc) + self.assertIsNotNone(updated_mc.oidc_issuer_profile) + self.assertTrue(updated_mc.oidc_issuer_profile.enabled) + + def test_update_oidc_issuer_profile__enabled_mc_enabled(self): + dec = AKSPreviewUpdateDecorator(self.cmd, self.client, { + "enable_oidc_issuer": True, + }, CUSTOM_MGMT_AKS_PREVIEW) + mc = self.models.ManagedCluster(location="test_location") + mc.oidc_issuer_profile = self.models.ManagedClusterOIDCIssuerProfile(enabled=True, issuer_url='https://issuer-url') + dec.context.attach_mc(mc) + updated_mc = dec.update_oidc_issuer_profile(mc) + self.assertIsNotNone(updated_mc.oidc_issuer_profile) + self.assertTrue(updated_mc.oidc_issuer_profile.enabled) + def test_patch_mc(self): # custom value dec_1 = AKSPreviewUpdateDecorator( diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 0cd31cb2d07..9625e696c7a 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -8,7 +8,7 @@ from codecs import open as open1 from setuptools import setup, find_packages -VERSION = "0.5.49" +VERSION = "0.5.50" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers',