NAS-123923 / 24.04 / update and enable collabora strategy (#1511)

* update and enable collabora strategy

* lint
This commit is contained in:
Stavros Kois
2023-09-06 15:36:08 +03:00
committed by GitHub
parent 2db0f5a0c1
commit bf22fd8596

View File

@@ -1,18 +1,23 @@
#!/usr/bin/python3
import json
import sys
import re
from catalog_update.upgrade_strategy import semantic_versioning
RE_STABLE_VERSION = re.compile(r'^\d+\.\d+\.\d+\.\d+\.\d+$')
def newer_mapping(image_tags):
key = list(image_tags.keys())[0]
version = semantic_versioning(sorted(image_tags[key], reverse=True))
tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
version = semantic_versioning(list(tags))
if not version:
return {}
return {
'tags': {key: version},
'tags': {key: tags[version]},
'app_version': version,
}