Jelajahi Sumber

Update nextcloud upgrade strategy

For nextcloud tags, 21.1 is greater then 21.1.0 so we reverse sort the tags list before doing semantic versioning as in semantic versioning both tags are equal and when we reverse sort it, 21.1 is prioritised over 21.1.0.
sonicaj 4 tahun lalu
induk
melakukan
4ea3f015f6
2 mengubah file dengan 4 tambahan dan 2 penghapusan
  1. 2 1
      charts/nextcloud/upgrade_strategy
  2. 2 1
      test/nextcloud/upgrade_strategy

+ 2 - 1
charts/nextcloud/upgrade_strategy

@@ -7,7 +7,8 @@ from catalog_update.upgrade_strategy import semantic_versioning
 
 def newer_mapping(image_tags):
     key = list(image_tags.keys())[0]
-    version = semantic_versioning(image_tags[key])
+    # 21.1 is greater then 21.1.0 so we reverse sort bfeore doing semantic versioning
+    version = semantic_versioning(sorted(image_tags[key], reverse=True))
     if not version:
         return {}
 

+ 2 - 1
test/nextcloud/upgrade_strategy

@@ -7,7 +7,8 @@ from catalog_update.upgrade_strategy import semantic_versioning
 
 def newer_mapping(image_tags):
     key = list(image_tags.keys())[0]
-    version = semantic_versioning(image_tags[key])
+    # 21.1 is greater then 21.1.0 so we reverse sort bfeore doing semantic versioning
+    version = semantic_versioning(sorted(image_tags[key], reverse=True))
     if not version:
         return {}