mirror of
https://github.com/truenas/charts.git
synced 2026-04-13 09:49:46 +08:00
Define upgrade strategy for automated updates for machinaris
This commit is contained in:
1
test/machinaris/upgrade_info.json
Normal file
1
test/machinaris/upgrade_info.json
Normal file
@@ -0,0 +1 @@
|
||||
{"filename": "ix_values.yaml", "keys": ["image"], "test_filename": "test_values.yaml"}
|
||||
25
test/machinaris/upgrade_strategy
Executable file
25
test/machinaris/upgrade_strategy
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python3
|
||||
import json
|
||||
import sys
|
||||
|
||||
from catalog_update.upgrade_strategy import semantic_versioning
|
||||
|
||||
|
||||
def newer_mapping(image_tags):
|
||||
key = list(image_tags.keys())[0]
|
||||
tags = {t.strip('v').replace('_', '.'): t for t in image_tags[key]}
|
||||
version = semantic_versioning(image_tags[key])
|
||||
if not version:
|
||||
return {}
|
||||
|
||||
return {
|
||||
'tags': {key: tags[version]},
|
||||
'app_version': tags[version],
|
||||
}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
exit(1)
|
||||
|
||||
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))
|
||||
Reference in New Issue
Block a user