File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,24 @@ def scan_binary(
260260 subprocess .run (cmd )
261261
262262
263+ _ARCH_SUFFIXES = ("-amd64" , "-arm64" )
264+
265+
266+ def _filter_redundant_manifest_tags (tags : list [str ]) -> list [str ]:
267+ """Remove non-arch-specific tags when arch-specific variants exist.
268+
269+ For example, if both "v4.5.1" and "v4.5.1-amd64" are present, the plain
270+ "v4.5.1" tag is dropped because the arch-specific tags already cover it.
271+ """
272+ arch_bases = {
273+ tag .removesuffix (suffix )
274+ for tag in tags
275+ for suffix in _ARCH_SUFFIXES
276+ if tag .endswith (suffix )
277+ }
278+ return [tag for tag in tags if tag not in arch_bases or tag .endswith (_ARCH_SUFFIXES )]
279+
280+
263281def scan_additional_images (secobserve_api_token : str ) -> None :
264282 """Scan additional images that are not part of the regular versioned Stackable release.
265283
@@ -285,7 +303,7 @@ def scan_additional_images(secobserve_api_token: str) -> None:
285303
286304 recent_tags , latest_tag = result
287305 if recent_tags :
288- tags = recent_tags
306+ tags = _filter_redundant_manifest_tags ( recent_tags )
289307 print (f"Found { len (tags )} recent tag(s) for { project } /{ repository } : { tags } " )
290308 elif latest_tag is not None :
291309 print (
You can’t perform that action at this time.
0 commit comments