-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[AKS] az aks create/update: Add new parameters --enable-gateway-api and --disable-gateway-api to manage Gateway API installation
#33238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
47ccbf1
9751288
599074b
78d9bdc
2745911
8617b70
723f986
babd432
1cb0bd1
2cd99af
a78d52e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,9 @@ | |
| CONST_AVAILABILITY_SET, | ||
| CONST_VIRTUAL_MACHINES, | ||
| CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH, | ||
| CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE | ||
| CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE, | ||
| CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED, | ||
| CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD, | ||
| ) | ||
| from azure.cli.command_modules.acs.azurecontainerstorage._consts import ( | ||
| CONST_ACSTOR_EXT_INSTALLATION_NAME, | ||
|
|
@@ -5973,6 +5975,20 @@ def get_node_provisioning_default_pools(self) -> Union[str, None]: | |
| """ | ||
| return self.raw_param.get("node_provisioning_default_pools") | ||
|
|
||
| def get_enable_gateway_api(self) -> bool: | ||
| """Obtain the value of enable_gateway_api. | ||
|
|
||
| :return: bool | ||
| """ | ||
| return self.raw_param.get("enable_gateway_api", False) | ||
|
|
||
| def get_disable_gateway_api(self) -> bool: | ||
| """Obtain the value of disable_gateway_api. | ||
|
|
||
| :return: bool | ||
| """ | ||
| return self.raw_param.get("disable_gateway_api", False) | ||
|
|
||
|
|
||
| class AKSManagedClusterCreateDecorator(BaseAKSManagedClusterDecorator): | ||
| def __init__( | ||
|
|
@@ -7362,6 +7378,19 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster: | |
|
|
||
| return mc | ||
|
|
||
| def set_up_ingress_profile_gateway_api(self, mc: ManagedCluster) -> ManagedCluster: | ||
| self._ensure_mc(mc) | ||
| if self.context.get_enable_gateway_api(): | ||
| if mc.ingress_profile is None: | ||
| mc.ingress_profile = self.models.ManagedClusterIngressProfile() | ||
| if mc.ingress_profile.gateway_api is None: | ||
| mc.ingress_profile.gateway_api = ( | ||
| self.models.ManagedClusterIngressProfileGatewayConfiguration( | ||
| installation=CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD | ||
| ) | ||
| ) | ||
| return mc | ||
|
|
||
| def set_up_ai_toolchain_operator(self, mc: ManagedCluster) -> ManagedCluster: | ||
| self._ensure_mc(mc) | ||
|
|
||
|
|
@@ -7514,6 +7543,8 @@ def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) -> | |
| mc = self.set_up_workload_auto_scaler_profile(mc) | ||
| # set up app routing profile | ||
| mc = self.set_up_ingress_web_app_routing(mc) | ||
| # set up gateway api | ||
| mc = self.set_up_ingress_profile_gateway_api(mc) | ||
| # set up custom ca trust certificates | ||
| mc = self.set_up_custom_ca_trust_certificates(mc) | ||
| # set up run command | ||
|
|
@@ -9011,6 +9042,31 @@ def _update_app_routing_nginx(self, mc: ManagedCluster, nginx) -> None: | |
| else: | ||
| raise CLIError('App Routing must be enabled to modify the default nginx ingress controller.\n') | ||
|
|
||
| def update_ingress_profile_gateway_api(self, mc: ManagedCluster) -> ManagedCluster: | ||
| """Update gateway api installation in the ingress profile for the ManagedCluster object. | ||
|
|
||
| :return: the ManagedCluster object | ||
| """ | ||
| self._ensure_mc(mc) | ||
| enable_gateway_api = self.context.get_enable_gateway_api() | ||
| disable_gateway_api = self.context.get_disable_gateway_api() | ||
| if enable_gateway_api and disable_gateway_api: | ||
| raise MutuallyExclusiveArgumentError( | ||
| "Cannot specify --enable-gateway-api and --disable-gateway-api at the same time." | ||
| ) | ||
| if enable_gateway_api or disable_gateway_api: | ||
| if mc.ingress_profile is None: | ||
| mc.ingress_profile = self.models.ManagedClusterIngressProfile() # pylint: disable=no-member | ||
| if mc.ingress_profile.gateway_api is None: | ||
| mc.ingress_profile.gateway_api = ( | ||
| self.models.ManagedClusterIngressProfileGatewayConfiguration() # pylint: disable=no-member | ||
| ) | ||
| if enable_gateway_api: | ||
| mc.ingress_profile.gateway_api.installation = CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD | ||
| elif disable_gateway_api: | ||
| mc.ingress_profile.gateway_api.installation = CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED | ||
| return mc | ||
|
Comment on lines
+9045
to
+9068
|
||
|
|
||
| def update_node_resource_group_profile(self, mc: ManagedCluster) -> ManagedCluster: | ||
| """Update node resource group profile for the ManagedCluster object. | ||
| :return: the ManagedCluster object | ||
|
|
@@ -9928,6 +9984,8 @@ def update_mc_profile_default(self) -> ManagedCluster: | |
| mc = self.update_node_resource_group_profile(mc) | ||
| # update AI toolchain operator | ||
| mc = self.update_ai_toolchain_operator(mc) | ||
| # update gateway api | ||
| mc = self.update_ingress_profile_gateway_api(mc) | ||
| # update bootstrap profile | ||
| mc = self.update_bootstrap_profile(mc) | ||
| # update static egress gateway | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15051,3 +15051,150 @@ def test_aks_nodepool_add_with_localdns_required_mode(self, resource_group, reso | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aks delete --resource-group={resource_group} --name={name} --yes --no-wait", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checks=[self.is_empty()], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @AllowLargeResponse() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @AKSCustomResourceGroupPreparer( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| random_name_length=17, name_prefix="clitest", location="centraluseuap" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def test_aks_create_with_gateway_api_and_azureservicemesh( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Queued live test to validate the change.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please commit recording files to pass built-in CI checks.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The live test failed with error
Please also resolve merge conflict. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aks_name = self.create_random_name("cliakstest", 16) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _, create_version = self._get_versions(resource_group_location) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| asm_revision = self._get_asm_supported_revision(resource_group_location) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.kwargs.update( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
meecethereese marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "resource_group": resource_group, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": aks_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "ssh_key_value": self.generate_ssh_keys(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "k8s_version": create_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "asm_revision": asm_revision, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test successful creation with Gateway API and Azure Service Mesh addon | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| create_cmd = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aks create --resource-group={resource_group} --name={name} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--enable-app-routing " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--enable-azure-service-mesh " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
meecethereese marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--enable-gateway-api " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--ssh-key-value={ssh_key_value} -o json " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.cmd( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| create_cmd, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checks=[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("provisioningState", "Succeeded"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("serviceMeshProfile.mode", "Istio"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test disabling Gateway API | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_cmd = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aks update --resource-group={resource_group} --name={name} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--disable-gateway-api " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.cmd( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_cmd, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checks=[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("provisioningState", "Succeeded"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("ingressProfile.gatewayApi.installation", "Disabled"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test re-enabling Gateway API | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_cmd = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "aks update --resource-group={resource_group} --name={name} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--enable-gateway-api " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.cmd( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_cmd, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checks=[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("provisioningState", "Succeeded"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+15078
to
+15119
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Test successful creation with Gateway API and Azure Service Mesh addon | |
| create_cmd = ( | |
| "aks create --resource-group={resource_group} --name={name} " | |
| "--enable-azure-service-mesh " | |
| "--enable-gateway-api " | |
| "--ssh-key-value={ssh_key_value} -o json " | |
| ) | |
| self.cmd( | |
| create_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("serviceMeshProfile.mode", "Istio"), | |
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | |
| ], | |
| ) | |
| # Test disabling Gateway API | |
| update_cmd = ( | |
| "aks update --resource-group={resource_group} --name={name} " | |
| "--disable-gateway-api " | |
| ) | |
| self.cmd( | |
| update_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("ingressProfile.gatewayApi.installation", "Disabled"), | |
| ], | |
| ) | |
| # Test re-enabling Gateway API | |
| update_cmd = ( | |
| "aks update --resource-group={resource_group} --name={name} " | |
| "--enable-gateway-api " | |
| ) | |
| self.cmd( | |
| update_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | |
| ], | |
| ) | |
| try: | |
| # Test successful creation with Gateway API and Azure Service Mesh addon | |
| create_cmd = ( | |
| "aks create --resource-group={resource_group} --name={name} " | |
| "--enable-azure-service-mesh " | |
| "--enable-gateway-api " | |
| "--ssh-key-value={ssh_key_value} -o json " | |
| ) | |
| self.cmd( | |
| create_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("serviceMeshProfile.mode", "Istio"), | |
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | |
| ], | |
| ) | |
| # Test disabling Gateway API | |
| update_cmd = ( | |
| "aks update --resource-group={resource_group} --name={name} " | |
| "--disable-gateway-api " | |
| ) | |
| self.cmd( | |
| update_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("ingressProfile.gatewayApi.installation", "Disabled"), | |
| ], | |
| ) | |
| # Test re-enabling Gateway API | |
| update_cmd = ( | |
| "aks update --resource-group={resource_group} --name={name} " | |
| "--enable-gateway-api " | |
| ) | |
| self.cmd( | |
| update_cmd, | |
| checks=[ | |
| self.check("provisioningState", "Succeeded"), | |
| self.check("ingressProfile.gatewayApi.installation", "Standard"), | |
| ], | |
| ) | |
| finally: | |
| self.cmd( | |
| "aks delete --resource-group={resource_group} --name={name} --yes --no-wait" | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--enable-gateway-api is documented as requiring an ingress provider (e.g., Azure Service Mesh/Istio), but this create-path setup unconditionally sets ingress_profile.gateway_api when the flag is present and does not validate the prerequisite. This means users may get a late RP-side failure or end up with an invalid configuration depending on RP behavior. Consider adding an explicit validation here (or in the context getter) that checks the relevant provider flags (e.g., enable_azure_service_mesh / other managed providers) and raises a clear CLI error before sending the PUT.