Commit 17635b74 authored by sonicaj's avatar sonicaj

Define upgrade strategy for automated updates for machinaris

parent 8b3badeb
{"filename": "ix_values.yaml", "keys": ["image"], "test_filename": "test_values.yaml"}
#!/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]))))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment