Skip to content

Commit dff1e2d

Browse files
Mauricio FerrariMauricio Ferrari
authored andcommitted
Remove managed gateway API changes from cherry-picked istio commits
The cherry-picked App Routing Istio commits from PR #33254 share branch ancestry with the Managed Gateway API changes from PR #33238. This commit surgically removes the gateway-api-only code that came along, while preserving the App Routing Istio functionality. Removed: - CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED/STANDARD constants - enable_gateway_api / disable_gateway_api parameters and help entries - set_up_ingress_profile_gateway_api / update_ingress_profile_gateway_api decorator methods - Associated unit and integration tests Kept: - App Routing Istio (CONST_APP_ROUTING_ISTIO_MODE_*) - gateway_api_implementations.app_routing_istio field handling
1 parent 32d8905 commit dff1e2d

7 files changed

Lines changed: 0 additions & 479 deletions

File tree

src/azure-cli/azure/cli/command_modules/acs/_consts.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@
209209
CONST_APP_ROUTING_INTERNAL_NGINX = "Internal"
210210
CONST_APP_ROUTING_NONE_NGINX = "None"
211211

212-
# managed gateway api installation
213-
CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED = "Disabled"
214-
CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD = "Standard"
215-
216212
# app routing istio mode
217213
CONST_APP_ROUTING_ISTIO_MODE_ENABLED = "Enabled"
218214
CONST_APP_ROUTING_ISTIO_MODE_DISABLED = "Disabled"

src/azure-cli/azure/cli/command_modules/acs/_help.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,6 @@
616616
- name: --enable-ai-toolchain-operator
617617
type: bool
618618
short-summary: Enable AI toolchain operator to the cluster.
619-
- name: --enable-gateway-api
620-
type: bool
621-
short-summary: Enable managed installation of Gateway API CRDs from the standard release channel. Requires at least one managed Gateway API ingress provider to be enabled.
622619
- name: --enable-app-routing-istio --enable-ari
623620
type: bool
624621
short-summary: Enable Gateway API based ingress on App Routing via Istio without service mesh functionality.
@@ -735,8 +732,6 @@
735732
text: az aks create -g MyResourceGroup -n MyManagedCluster --node-provisioning-mode Auto --node-provisioning-default-pools None
736733
- name: Create a Kubernetes cluster with KataVmIsolation enabled.
737734
text: az aks create -g MyResourceGroup -n MyManagedCluster --os-sku AzureLinux --vm-size Standard_D4s_v3 --workload-runtime KataVmIsolation --node-count 1
738-
- name: Create a kubernetes cluster with the Azure Service Mesh addon enabled with a managed installation of Gateway API CRDs from the standard release channel.
739-
text: az aks create -g MyResourceGroup -n MyManagedCluster --enable-azure-service-mesh --enable-gateway-api
740735
"""
741736

742737
helps["aks update"] = """
@@ -1154,12 +1149,6 @@
11541149
- name: --disable-ai-toolchain-operator
11551150
type: bool
11561151
short-summary: Disable AI toolchain operator.
1157-
- name: --enable-gateway-api
1158-
type: bool
1159-
short-summary: Enable managed installation of Gateway API CRDs from the standard release channel. Requires at least one managed Gateway API ingress provider to be enabled.
1160-
- name: --disable-gateway-api
1161-
type: bool
1162-
short-summary: Disable managed installation of Gateway API CRDs.
11631152
- name: --enable-app-routing-istio --enable-ari
11641153
type: bool
11651154
short-summary: Enable Gateway API based ingress on App Routing via Istio without service mesh functionality.
@@ -1258,10 +1247,6 @@
12581247
text: az aks update -g MyResourceGroup -n MyManagedCluster --node-provisioning-mode Auto --node-provisioning-default-pools None
12591248
- name: Upgrade load balancer sku to standard
12601249
text: az aks update --load-balancer-sku standard -g MyResourceGroup -n MyManagedCluster
1261-
- name: Update a kubernetes cluster to enable a managed installation of Gateway API CRDs from the standard release channel.
1262-
text: az aks update -g MyResourceGroup -n MyManagedCluster --enable-gateway-api
1263-
- name: Update a kubernetes cluster to disable the managed installation of Gateway API CRDs.
1264-
text: az aks update -g MyResourceGroup -n MyManagedCluster --disable-gateway-api
12651250
"""
12661251

12671252
helps["aks delete"] = """

src/azure-cli/azure/cli/command_modules/acs/_params.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -650,12 +650,6 @@ def load_arguments(self, _):
650650
'by that action.'
651651
)
652652
)
653-
c.argument(
654-
"enable_gateway_api",
655-
action="store_true",
656-
help="Enable managed installation of Gateway API CRDs from the standard release channel. "
657-
"Requires a Gateway API implementation to be installed on the cluster (e.g., Azure Service Mesh)."
658-
)
659653
c.argument(
660654
"enable_app_routing_istio",
661655
options_list=["--enable-app-routing-istio", "--enable-ari"],
@@ -885,17 +879,6 @@ def load_arguments(self, _):
885879
'by that action.'
886880
)
887881
)
888-
c.argument(
889-
"enable_gateway_api",
890-
action="store_true",
891-
help="Enable managed installation of Gateway API CRDs from the standard release channel. "
892-
"Requires a Gateway API implementation to be installed on the cluster (e.g., Azure Service Mesh)."
893-
)
894-
c.argument(
895-
"disable_gateway_api",
896-
action="store_true",
897-
help="Disable managed installation of Gateway API CRDs."
898-
)
899882
c.argument(
900883
"enable_app_routing_istio",
901884
options_list=["--enable-app-routing-istio", "--enable-ari"],

src/azure-cli/azure/cli/command_modules/acs/custom.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,8 +1035,6 @@ def aks_create(
10351035
# node provisioning
10361036
node_provisioning_mode=None,
10371037
node_provisioning_default_pools=None,
1038-
# gateway api
1039-
enable_gateway_api=False,
10401038
# app routing istio
10411039
enable_app_routing_istio=False,
10421040
):
@@ -1232,9 +1230,6 @@ def aks_update(
12321230
# node provisioning
12331231
node_provisioning_mode=None,
12341232
node_provisioning_default_pools=None,
1235-
# gateway api
1236-
enable_gateway_api=False,
1237-
disable_gateway_api=False,
12381233
# app routing istio
12391234
enable_app_routing_istio=False,
12401235
disable_app_routing_istio=False,

src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
CONST_VIRTUAL_MACHINES,
5151
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
5252
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
53-
CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED,
54-
CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD,
5553
CONST_APP_ROUTING_ISTIO_MODE_ENABLED,
5654
CONST_APP_ROUTING_ISTIO_MODE_DISABLED,
5755
)
@@ -5977,20 +5975,6 @@ def get_node_provisioning_default_pools(self) -> Union[str, None]:
59775975
"""
59785976
return self.raw_param.get("node_provisioning_default_pools")
59795977

5980-
def get_enable_gateway_api(self) -> bool:
5981-
"""Obtain the value of enable_gateway_api.
5982-
5983-
:return: bool
5984-
"""
5985-
return self.raw_param.get("enable_gateway_api", False)
5986-
5987-
def get_disable_gateway_api(self) -> bool:
5988-
"""Obtain the value of disable_gateway_api.
5989-
5990-
:return: bool
5991-
"""
5992-
return self.raw_param.get("disable_gateway_api", False)
5993-
59945978
def get_enable_app_routing_istio(self) -> bool:
59955979
"""Obtain the value of enable_app_routing_istio.
59965980
@@ -7394,19 +7378,6 @@ def set_up_ingress_web_app_routing(self, mc: ManagedCluster) -> ManagedCluster:
73947378

73957379
return mc
73967380

7397-
def set_up_ingress_profile_gateway_api(self, mc: ManagedCluster) -> ManagedCluster:
7398-
self._ensure_mc(mc)
7399-
if self.context.get_enable_gateway_api():
7400-
if mc.ingress_profile is None:
7401-
mc.ingress_profile = self.models.ManagedClusterIngressProfile()
7402-
if mc.ingress_profile.gateway_api is None:
7403-
mc.ingress_profile.gateway_api = (
7404-
self.models.ManagedClusterIngressProfileGatewayConfiguration(
7405-
installation=CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD
7406-
)
7407-
)
7408-
return mc
7409-
74107381
def set_up_ingress_profile_app_routing_istio(self, mc: ManagedCluster) -> ManagedCluster:
74117382
"""Set up App Routing Istio configuration in ingress profile for the ManagedCluster object.
74127383
@@ -7585,8 +7556,6 @@ def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) ->
75857556
mc = self.set_up_workload_auto_scaler_profile(mc)
75867557
# set up app routing profile
75877558
mc = self.set_up_ingress_web_app_routing(mc)
7588-
# set up gateway api
7589-
mc = self.set_up_ingress_profile_gateway_api(mc)
75907559
# set up app routing istio
75917560
mc = self.set_up_ingress_profile_app_routing_istio(mc)
75927561
# set up custom ca trust certificates
@@ -9086,31 +9055,6 @@ def _update_app_routing_nginx(self, mc: ManagedCluster, nginx) -> None:
90869055
else:
90879056
raise CLIError('App Routing must be enabled to modify the default nginx ingress controller.\n')
90889057

9089-
def update_ingress_profile_gateway_api(self, mc: ManagedCluster) -> ManagedCluster:
9090-
"""Update gateway api installation in the ingress profile for the ManagedCluster object.
9091-
9092-
:return: the ManagedCluster object
9093-
"""
9094-
self._ensure_mc(mc)
9095-
enable_gateway_api = self.context.get_enable_gateway_api()
9096-
disable_gateway_api = self.context.get_disable_gateway_api()
9097-
if enable_gateway_api and disable_gateway_api:
9098-
raise MutuallyExclusiveArgumentError(
9099-
"Cannot specify --enable-gateway-api and --disable-gateway-api at the same time."
9100-
)
9101-
if enable_gateway_api or disable_gateway_api:
9102-
if mc.ingress_profile is None:
9103-
mc.ingress_profile = self.models.ManagedClusterIngressProfile() # pylint: disable=no-member
9104-
if mc.ingress_profile.gateway_api is None:
9105-
mc.ingress_profile.gateway_api = (
9106-
self.models.ManagedClusterIngressProfileGatewayConfiguration() # pylint: disable=no-member
9107-
)
9108-
if enable_gateway_api:
9109-
mc.ingress_profile.gateway_api.installation = CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD
9110-
elif disable_gateway_api:
9111-
mc.ingress_profile.gateway_api.installation = CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED
9112-
return mc
9113-
91149058
def update_ingress_profile_app_routing_istio(self, mc: ManagedCluster) -> ManagedCluster:
91159059
"""Update App Routing Istio configuration in ingress profile for the ManagedCluster object.
91169060
@@ -10065,8 +10009,6 @@ def update_mc_profile_default(self) -> ManagedCluster:
1006510009
mc = self.update_node_resource_group_profile(mc)
1006610010
# update AI toolchain operator
1006710011
mc = self.update_ai_toolchain_operator(mc)
10068-
# update gateway api
10069-
mc = self.update_ingress_profile_gateway_api(mc)
1007010012
# update app routing istio
1007110013
mc = self.update_ingress_profile_app_routing_istio(mc)
1007210014
# update bootstrap profile

src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -15052,138 +15052,6 @@ def test_aks_nodepool_add_with_localdns_required_mode(self, resource_group, reso
1505215052
checks=[self.is_empty()],
1505315053
)
1505415054

15055-
@AllowLargeResponse()
15056-
@AKSCustomResourceGroupPreparer(
15057-
random_name_length=17, name_prefix="clitest", location="centraluseuap"
15058-
)
15059-
def test_aks_create_with_gateway_api_and_azureservicemesh(
15060-
self, resource_group, resource_group_location
15061-
):
15062-
# reset the count so in replay mode the random names will start with 0
15063-
self.test_resources_count = 0
15064-
15065-
aks_name = self.create_random_name("cliakstest", 16)
15066-
_, create_version = self._get_versions(resource_group_location)
15067-
asm_revision = self._get_asm_supported_revision(resource_group_location)
15068-
self.kwargs.update(
15069-
{
15070-
"resource_group": resource_group,
15071-
"name": aks_name,
15072-
"ssh_key_value": self.generate_ssh_keys(),
15073-
"k8s_version": create_version,
15074-
"asm_revision": asm_revision,
15075-
}
15076-
)
15077-
15078-
# Test successful creation with Gateway API and Azure Service Mesh addon
15079-
create_cmd = (
15080-
"aks create --resource-group={resource_group} --name={name} "
15081-
"--enable-azure-service-mesh "
15082-
"--enable-gateway-api "
15083-
"--ssh-key-value={ssh_key_value} -o json "
15084-
)
15085-
self.cmd(
15086-
create_cmd,
15087-
checks=[
15088-
self.check("provisioningState", "Succeeded"),
15089-
self.check("serviceMeshProfile.mode", "Istio"),
15090-
self.check("ingressProfile.gatewayApi.installation", "Standard"),
15091-
],
15092-
)
15093-
15094-
# Test disabling Gateway API
15095-
update_cmd = (
15096-
"aks update --resource-group={resource_group} --name={name} "
15097-
"--disable-gateway-api "
15098-
)
15099-
self.cmd(
15100-
update_cmd,
15101-
checks=[
15102-
self.check("provisioningState", "Succeeded"),
15103-
self.check("ingressProfile.gatewayApi.installation", "Disabled"),
15104-
],
15105-
)
15106-
15107-
# Test re-enabling Gateway API
15108-
update_cmd = (
15109-
"aks update --resource-group={resource_group} --name={name} "
15110-
"--enable-gateway-api "
15111-
)
15112-
self.cmd(
15113-
update_cmd,
15114-
checks=[
15115-
self.check("provisioningState", "Succeeded"),
15116-
self.check("ingressProfile.gatewayApi.installation", "Standard"),
15117-
],
15118-
)
15119-
15120-
# Cleanup
15121-
self.cmd(
15122-
"aks delete --resource-group={resource_group} --name={name} --yes --no-wait",
15123-
checks=[self.is_empty()],
15124-
)
15125-
15126-
15127-
@AllowLargeResponse()
15128-
@AKSCustomResourceGroupPreparer(
15129-
random_name_length=17, name_prefix="clitest", location="centraluseuap"
15130-
)
15131-
def test_aks_managed_gateway_requires_service_mesh(
15132-
self, resource_group, resource_group_location
15133-
):
15134-
"""
15135-
Verify that enabling managed Gateway API requires a Gateway API implementation (e.g., Azure Service Mesh).
15136-
15137-
This test:
15138-
- Attempts and fails to create a cluster with --enable-gateway-api without ASM enabled.
15139-
- Creates a minimal cluster.
15140-
- Attempts and fails to update it with --enable-gateway-api (still without ASM).
15141-
"""
15142-
15143-
# reset the count so in replay mode the random names will start with 0
15144-
self.test_resources_count = 0
15145-
15146-
aks_name = self.create_random_name("cliakstest", 16)
15147-
self.kwargs.update(
15148-
{
15149-
"resource_group": resource_group,
15150-
"name": aks_name,
15151-
"ssh_key_value": self.generate_ssh_keys(),
15152-
"location": resource_group_location,
15153-
}
15154-
)
15155-
15156-
# Attempt and expect failure to create a cluster with Gateway API but without ASM
15157-
create_with_gateway_cmd = (
15158-
"aks create --resource-group={resource_group} --name={name} "
15159-
"--enable-gateway-api "
15160-
"--ssh-key-value={ssh_key_value} -o json "
15161-
)
15162-
self.cmd(create_with_gateway_cmd, expect_failure=True)
15163-
15164-
# Create a minimal cluster without Gateway API or ASM
15165-
create_minimal_cmd = (
15166-
"aks create --resource-group={resource_group} --name={name} "
15167-
"--ssh-key-value={ssh_key_value} -o json"
15168-
)
15169-
self.cmd(
15170-
create_minimal_cmd,
15171-
checks=[
15172-
self.check("provisioningState", "Succeeded"),
15173-
],
15174-
)
15175-
15176-
# Attempt and expect failure to enable Gateway API on an existing cluster without ASM
15177-
update_enable_gateway_cmd = (
15178-
"aks update --resource-group={resource_group} --name={name} "
15179-
"--enable-gateway-api "
15180-
)
15181-
self.cmd(update_enable_gateway_cmd, expect_failure=True)
15182-
15183-
# Cleanup
15184-
delete_cmd = "aks delete --resource-group={resource_group} --name={name} --yes --no-wait"
15185-
self.cmd(delete_cmd, checks=[self.is_empty()])
15186-
1518715055
@AllowLargeResponse()
1518815056
@AKSCustomResourceGroupPreparer(
1518915057
random_name_length=17, name_prefix="clitest", location="centraluseuap"

0 commit comments

Comments
 (0)