mirror of
https://github.com/truenas/charts.git
synced 2026-04-23 18:10:06 +08:00
tdarr: handle version numbers with leading zeros (e.g. 2.21.01) (#2604)
Using compiled regex to strip leading zeros in front of other digits
This commit is contained in:
@@ -3,7 +3,7 @@ description: Tdarr is a Distributed Transcoding System
|
||||
annotations:
|
||||
title: Tdarr
|
||||
type: application
|
||||
version: 1.2.4
|
||||
version: 1.2.5
|
||||
apiVersion: v2
|
||||
appVersion: 2.17.01
|
||||
kubeVersion: '>=1.16.0-0'
|
||||
|
||||
@@ -8,12 +8,13 @@ from catalog_update.upgrade_strategy import semantic_versioning
|
||||
|
||||
# Drop _ffmpeg5 after Cobia is released for a while
|
||||
RE_STABLE_VERSION = re.compile(r'[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?(_ffmpeg5)?')
|
||||
RE_CLEAN_VERSION = re.compile(r'0+([1-9])')
|
||||
STRIP_TEXT = '_ffmpeg5'
|
||||
|
||||
|
||||
def newer_mapping(image_tags):
|
||||
key = list(image_tags.keys())[0]
|
||||
tags = {t.strip(STRIP_TEXT): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
|
||||
tags = {RE_CLEAN_VERSION.sub("\\1", t.strip(STRIP_TEXT)): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
|
||||
version = semantic_versioning(list(tags))
|
||||
if not version:
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user