From 0ea4c4ef825854998f83c1fb48351e00dff77d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Wed, 9 Oct 2024 22:43:10 +0200 Subject: [PATCH] Set ForceMultiVersion for AppCollection containers The AppCollection registry requires sequential release numbers for proper displaying. We probably should do the same for registry.suse.com at some point. --- src/bci_build/registry.py | 9 ++++++++- src/bci_build/templates.py | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bci_build/registry.py b/src/bci_build/registry.py index 62af212ce..04368399b 100644 --- a/src/bci_build/registry.py +++ b/src/bci_build/registry.py @@ -17,11 +17,16 @@ class Registry(ABC): """Abstract Base Class for defining Registry specific content.""" _: dataclasses.KW_ONLY + """The base hostname for this registry instance""" registry: str + """The vendor that is put into the ``org.opencontainers.image.vendor`` label""" vendor: str + """enforce sequential release numbers even across version chagnes.""" + force_multiversion: bool = False + @staticmethod @abstractmethod def url(container: "BaseContainerImage") -> str: @@ -44,7 +49,9 @@ class ApplicationCollectionRegistry(Registry): """Registry for the Rancher Application Collection Distribution Platform.""" def __init__(self): - super().__init__(registry="dp.apps.rancher.io", vendor="SUSE LLC") + super().__init__( + registry="dp.apps.rancher.io", vendor="SUSE LLC", force_multiversion=True + ) @staticmethod def url(container: "BaseContainerImage") -> str: diff --git a/src/bci_build/templates.py b/src/bci_build/templates.py index ff31684a7..4d3281832 100644 --- a/src/bci_build/templates.py +++ b/src/bci_build/templates.py @@ -32,6 +32,8 @@ {% for tag in image.build_tags -%} #!BuildTag: {{ tag }} {% endfor -%} +{%- if image.publish_registry.force_multiversion -%}#!ForceMultiVersion +{% endif -%} {% if image.build_version %}#!BuildName: {{ image.build_name }} #!BuildVersion: {{ image.build_version }} {%- endif %}