mirror of
https://github.com/truenas/charts.git
synced 2026-04-10 06:07:58 +08:00
fix collabora upgrade strategy (#1547)
This commit is contained in:
@@ -16,6 +16,9 @@ def newer_mapping(image_tags):
|
||||
for tag in temp_tags:
|
||||
tag = tag.split('.')
|
||||
for i in range(len(tag)):
|
||||
# Ignore the first two parts as they are supposed to have leading zeros
|
||||
if i in [0, 1]:
|
||||
continue
|
||||
# Add leading zero to single digit numbers
|
||||
if len(tag[i]) == 1:
|
||||
tag[i] = '0' + tag[i]
|
||||
@@ -26,9 +29,21 @@ def newer_mapping(image_tags):
|
||||
if not version:
|
||||
return {}
|
||||
|
||||
cleanVersion = ""
|
||||
for idx, part in enumerate(version.split('.')):
|
||||
# Ignore the first two parts as they are supposed to have leading zeros
|
||||
if idx in [0, 1]:
|
||||
cleanVersion += part + '.'
|
||||
continue
|
||||
# Remove leading zero
|
||||
cleanVersion += part.lstrip('0') + '.'
|
||||
|
||||
# Remove trailing dot
|
||||
cleanVersion = cleanVersion.rstrip('.')
|
||||
|
||||
return {
|
||||
'tags': {key: tags[version]},
|
||||
'app_version': version,
|
||||
'tags': {key: cleanVersion},
|
||||
'app_version': cleanVersion,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user