Skip to content
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

Add parameter to set revision --revision for the Azure Service Mesh addon while creating AKS cluster. #7270

Merged
merged 12 commits into from
Feb 29, 2024
1 change: 1 addition & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pending
+++++++
* Vendor new SDK and bump API version to 2023-11-02-preview.
* Implicitly enable istio when ingress or egress gateway is enabled for Azure Service Mesh.
* Add parameter to set revision `--revision` for the Azure Service Mesh addon while creating AKS cluster.
deveshdama marked this conversation as resolved.
Show resolved Hide resolved

1.0.0b5
+++++++
Expand Down
3 changes: 3 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@
- name: --enable-asm --enable-azure-service-mesh
type: bool
short-summary: Enable Azure Service Mesh.
- name: --revision
type: string
short-summary: Azure Service Mesh revision to install.
- name: --enable-azuremonitormetrics
type: bool
short-summary: Enable Azure Monitor Metrics Profile
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ def load_arguments(self, _):
action="store_true",
is_preview=True,
)
c.argument("revision", validator=validate_azure_service_mesh_revision)
c.argument("image_cleaner_interval_hours", type=int)
c.argument(
"cluster_snapshot_id",
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ def aks_create(
guardrails_excluded_ns=None,
# azure service mesh
enable_azure_service_mesh=None,
revision=None,
# azure monitor profile
enable_azuremonitormetrics=False,
enable_azure_monitor_metrics=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2065,10 +2065,17 @@ def get_initial_service_mesh_profile(self) -> ServiceMeshProfile:

# returns a service mesh profile only if '--enable-azure-service-mesh' is applied
enable_asm = self.raw_param.get("enable_azure_service_mesh", False)
revision = self.raw_param.get("revision", None)
if revision is None:
revisions = []
else:
revisions = [revision]
if enable_asm:
return self.models.ServiceMeshProfile( # pylint: disable=no-member
mode=CONST_AZURE_SERVICE_MESH_MODE_ISTIO,
istio=self.models.IstioServiceMesh(), # pylint: disable=no-member
istio=self.models.IstioServiceMesh(
revisions=revisions
), # pylint: disable=no-member
)

return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4857,6 +4857,7 @@ def test_set_up_azure_service_mesh(self):
self.client,
{
"enable_azure_service_mesh": True,
"revision": "asm-1-88"
},
CUSTOM_MGMT_AKS_PREVIEW,
)
Expand All @@ -4867,7 +4868,9 @@ def test_set_up_azure_service_mesh(self):
ground_truth_mc_2 = self.models.ManagedCluster(
location="test_location",
service_mesh_profile=self.models.ServiceMeshProfile(
mode="Istio", istio=self.models.IstioServiceMesh()
mode="Istio", istio=self.models.IstioServiceMesh(
revisions=["asm-1-88"]
deveshdama marked this conversation as resolved.
Show resolved Hide resolved
)
),
)

Expand Down