Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
container.yml: Add PATCH to tags
Browse files Browse the repository at this point in the history
v3.11 relies on images being pullable through with a tag like
`:v3.11.345`. This change ensures the patch version is included in
`container.yml`.
  • Loading branch information
joepvd committed Nov 23, 2021
1 parent 3982f51 commit 34c0b77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doozerlib/distgit.py
Expand Up @@ -523,6 +523,8 @@ def _generate_osbs_image_config(self, version: str) -> Dict:
vsplit = version.split(".") # Split the version number: v4.3.4 => [ 'v4', '3, '4' ]
if len(vsplit) > 1:
floating_tags.add(f"{vsplit[0]}.{vsplit[1]}")
if len(vsplit) > 2:
floating_tags.add(f"{vsplit[0]}.{vsplit[1]}.{vsplit[2]}")
if self.metadata.config.additional_tags:
floating_tags |= set(self.metadata.config.additional_tags)
if floating_tags:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_distgit/test_image_distgit/test_image_distgit.py
Expand Up @@ -493,12 +493,12 @@ def test_generate_osbs_image_config_with_addtional_tags(self):
# assembly is not enabled
runtime.assembly = None
container_yaml = dg._generate_osbs_image_config("v4.10.0")
self.assertEqual(sorted(container_yaml["tags"]), sorted(['v4.10.0.123456', 'v4.10', 'tag_a', 'tag_b']))
self.assertEqual(sorted(container_yaml["tags"]), sorted(['v4.10.0.123456', 'v4.10', 'v4.10.0', 'tag_a', 'tag_b']))

# assembly is enabled
runtime.assembly = "art3109"
container_yaml = dg._generate_osbs_image_config("v4.10.0")
self.assertEqual(sorted(container_yaml["tags"]), sorted(['assembly.art3109', 'v4.10.0.123456', 'v4.10', 'tag_a', 'tag_b']))
self.assertEqual(sorted(container_yaml["tags"]), sorted(['assembly.art3109', 'v4.10.0.123456', 'v4.10', 'v4.10.0', 'tag_a', 'tag_b']))


if __name__ == "__main__":
Expand Down

0 comments on commit 34c0b77

Please sign in to comment.