Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,15 @@ def _convert_revision_to_semver(rev):
sorted_revisions = sorted(revisions, key=_convert_revision_to_semver)
return sorted_revisions

def _get_asm_supported_revision(self, location):
def _get_asm_supported_revision(self, location, secondLatest=False):
mesh_revisions_cmd = f"aks mesh get-revisions -l {location}"
mesh_revisions = self.cmd(mesh_revisions_cmd).get_output_in_json()
assert len(mesh_revisions["meshRevisions"]) > 0
revisions = [r["revision"] for r in mesh_revisions["meshRevisions"]]
sorted_revisons = self._sort_revisions(revisions)
lenRevisions = len(sorted_revisons)
if secondLatest and lenRevisions > 1:
return sorted_revisons[lenRevisions - 2] # Return the second latest revision
return sorted_revisons[0]

def _get_asm_upgrade_version(self, resource_group, name):
Expand Down Expand Up @@ -12541,7 +12544,7 @@ def test_aks_azure_service_mesh_enable_disable(
"name": aks_name,
"location": resource_group_location,
"ssh_key_value": self.generate_ssh_keys(),
"revision": self._get_asm_supported_revision(resource_group_location),
"revision": self._get_asm_supported_revision(resource_group_location, False),
}
)

Expand Down Expand Up @@ -12615,7 +12618,7 @@ def test_aks_azure_service_mesh_with_egress_gateway(
"name": aks_name,
"location": resource_group_location,
"ssh_key_value": self.generate_ssh_keys(),
"revision": self._get_asm_supported_revision("westus2"), # Temporarily set to prod region to avoid using unsupported ASM revision for centraluseap
"revision": self._get_asm_supported_revision(resource_group_location, True),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad to see the fix works, but I am curious why this test case needs the second latest version, what makes it special?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set the default location to eastus2euap, whereas other scenarios are westus2 - this is because for Static Egress Gateway, I was previously running into quota issues for the gateway nodepool in the CLI e2es test when I used westus2 as the location.

However, eastus2euap returns a different list of revisions compared to westus2 - so I need to make sure that the revision is supported by using the second to last one.

}
)

Expand Down Expand Up @@ -12823,7 +12826,7 @@ def test_aks_azure_service_mesh_with_ingress_gateway(
"name": aks_name,
"location": resource_group_location,
"ssh_key_value": self.generate_ssh_keys(),
"revision": self._get_asm_supported_revision(resource_group_location),
"revision": self._get_asm_supported_revision(resource_group_location, False),
}
)

Expand Down Expand Up @@ -12909,7 +12912,7 @@ def test_aks_azure_service_mesh_canary_upgrade(
self.test_resources_count = 0
# kwargs for string formatting
aks_name = self.create_random_name("cliakstest", 16)
installed_revision = self._get_asm_supported_revision(resource_group_location)
installed_revision = self._get_asm_supported_revision(resource_group_location, False)
self.kwargs.update(
{
"resource_group": resource_group,
Expand Down Expand Up @@ -13036,7 +13039,7 @@ def test_aks_azure_service_mesh_with_pluginca(
"location": resource_group_location,
"ssh_key_value": self.generate_ssh_keys(),
"akv_resource_id": akv_resource_id,
"revision": self._get_asm_supported_revision(resource_group_location),
"revision": self._get_asm_supported_revision(resource_group_location, False),
}
)

Expand Down Expand Up @@ -13144,7 +13147,7 @@ def test_aks_azure_service_mesh_get_upgrades(
"name": aks_name,
"location": resource_group_location,
"ssh_key_value": self.generate_ssh_keys(),
"revision": self._get_asm_supported_revision(resource_group_location),
"revision": self._get_asm_supported_revision(resource_group_location, False),
}
)

Expand Down
Loading