Skip to content

Commit

Permalink
fix(get-images): retrun exact versions as needed
Browse files Browse the repository at this point in the history
when we ask for exact version so far, we might get newer
version that contains the version asked

for example asking for `2024.1.1`, we would get both `2024.1.1` and `2024.1.10`
sorted in a way that newer is first, and that what would be used.

this change is limiting the filters in both AWS and GCE, if exact version
was asked

(similar as it's now on Azure backend)
  • Loading branch information
fruch authored and roydahan committed Oct 7, 2024
1 parent 2b2ef12 commit d3b56f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdcm/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,11 @@ def get_scylla_ami_versions(region_name: str, arch: AwsArchType = 'x86_64', vers
name_filter = "ScyllaDB *"

if version and version != "all":
name_filter = f"ScyllaDB *{version.replace('enterprise-', 'Enterprise ')}*"
name_filter = f"ScyllaDB *{version.replace('enterprise-', 'Enterprise ')}"

if len(version.split('.')) < 3:
# if version is not exact version, we need to add the wildcard to the end, to catch all minor versions
name_filter = f"{name_filter}*"

ec2_resource: EC2ServiceResource = boto3.resource('ec2', region_name=region_name)
images = []
Expand Down Expand Up @@ -1165,7 +1169,7 @@ def get_scylla_gce_images_versions(project: str = SCYLLA_GCE_IMAGES_PROJECT, ver

if version and version != "all":
filters += f"(name eq 'scylla(db)?(-enterprise)?-{version.replace('.', '-')}"
if 'rc' not in version:
if 'rc' not in version and len(version.split('.')) < 3:
filters += "(-\\d)?(\\d)?(\\d)?(-rc)?(\\d)?(\\d)?')"
else:
filters += "')"
Expand Down

0 comments on commit d3b56f6

Please sign in to comment.