Skip to content

Commit

Permalink
Merge pull request #1829 from SUSE/enforce_multiversion
Browse files Browse the repository at this point in the history
Set ForceMultiVersion for AppCollection containers
  • Loading branch information
dcermak authored Oct 10, 2024
2 parents baa71ee + 0ea4c4e commit 8e8e6b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bci_build/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/bci_build/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 8e8e6b9

Please sign in to comment.