@@ -55,7 +55,7 @@ Build = collections.namedtuple("Build", ["id", "images", "arch", "meta_json"])
55
55
# set metadata caching to 5m
56
56
CACHE_MAX_AGE_METADATA = 60 * 5
57
57
# These lists are up to date as of schema hash
58
- # 58da31f35c1405d5a752a297d0ee012f577720f810113d38cdabca102ec7edd8 . If changing
58
+ # 1711aa3ce997c644130139e1318d2683e2a5f11538e2b0528771a8658d62ee64 . If changing
59
59
# this hash, ensure that the list of SUPPORTED and UNSUPPORTED artifacts below
60
60
# is up to date.
61
61
SUPPORTED = ["amis" , "gcp" ]
@@ -185,12 +185,13 @@ def main():
185
185
print (f"\t \t \t Release { build_id } is a barrier release. Skipping container prune." )
186
186
continue
187
187
# Retrieve container tags excluding the stream name since it updates with each release.
188
- container_tags , container_repo = get_container_tags (meta_json , exclude = [stream ])
189
- if container_tags :
190
- for tag in container_tags :
191
- prune_container (tag , args .dry_run , container_repo , args .registry_auth_file )
192
- else :
193
- print (f"\t \t \t No container tags to prune for build { build_id } ." )
188
+ containers = get_container_tags (meta_json , exclude = [stream ])
189
+ for (container_repo , container_tags ) in containers :
190
+ if container_tags :
191
+ for tag in container_tags :
192
+ prune_container (tag , args .dry_run , container_repo , args .registry_auth_file )
193
+ else :
194
+ print (f"\t \t \t No container tags to prune for build { build_id } ." )
194
195
actions_completed .append (action ) # Append action to completed list
195
196
# Only add policy-cleanup for the build in builds.json if any
196
197
# of the cleanup actions were completed.
@@ -450,9 +451,14 @@ def get_container_tags(meta_json, exclude):
450
451
if base_oscontainer :
451
452
tags = base_oscontainer .get ("tags" , [])
452
453
filtered_tags = [tag for tag in tags if tag not in exclude ]
453
- container_repo = base_oscontainer .get ("image" , "" )
454
- return filtered_tags , container_repo
455
- return [], ""
454
+ container_repos = [(base_oscontainer .get ("image" , "" ), filtered_tags )]
455
+ additional_images = base_oscontainer .get ("additional-images" , [])
456
+ for image in additional_images :
457
+ tags = image .get ("tags" , [])
458
+ filtered_tags = [tag for tag in tags if tag not in exclude ]
459
+ container_repos .append ((image .get ("image" , "" ), filtered_tags ))
460
+ return container_repos
461
+ return []
456
462
457
463
458
464
def prune_container (tag , dry_run , container_repo , registry_auth_file ):
0 commit comments