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

container.yml: Add PATCH to tags #539

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doozerlib/distgit.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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