Browse Source

NAS-124014 / 24.04 / fix collabora update strategy (#1524)

Stavros Kois 1 year ago
parent
commit
b7fbe1a7ab
1 changed files with 14 additions and 4 deletions
  1. 14 4
      library/ix-dev/charts/collabora/upgrade_strategy

+ 14 - 4
library/ix-dev/charts/collabora/upgrade_strategy

@@ -3,16 +3,26 @@ import json
 import sys
 import re
 
-from catalog_update.upgrade_strategy import semantic_versioning
+from catalog_update.upgrade_strategy import datetime_versioning
 
 
-RE_STABLE_VERSION = re.compile(r'^\d+\.\d+\.\d+\.\d+\.\d+$')
+RE_STABLE_VERSION = re.compile(r'^(\d+\.){4}\d+$')
 
 
 def newer_mapping(image_tags):
     key = list(image_tags.keys())[0]
-    tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
-    version = semantic_versioning(list(tags))
+    temp_tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
+    tags = {}
+    for tag in temp_tags:
+        tag = tag.split('.')
+        for i in range(len(tag)):
+            # Add leading zero to single digit numbers
+            if len(tag[i]) == 1:
+                tag[i] = '0' + tag[i]
+        tag = '.'.join(tag)
+        tags[tag] = tag
+
+    version = datetime_versioning(list(tags), '%y.%m.%d.%H.%M')
     if not version:
         return {}