From 76a10ea458486dc02990c3b83ef60efe31f64066 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 21 Sep 2023 20:02:54 +0200 Subject: [PATCH] fix: correctly handle rc container names Signed-off-by: Paul Spooren --- asu/common.py | 2 +- tests/test_common.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/asu/common.py b/asu/common.py index abeab8a6..abaf396e 100644 --- a/asu/common.py +++ b/asu/common.py @@ -201,7 +201,7 @@ def remove_prefix(text, prefix): def get_container_version_tag(version: str) -> str: - if match(r"^\d+\.\d+\.\d+$", version): + if match(r"^\d+\.\d+\.\d+(-rc\d+)?$", version): logging.debug("Version is a release version") version: str = "v" + version else: diff --git a/tests/test_common.py b/tests/test_common.py index cb08fb9c..a53c75f6 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -78,6 +78,7 @@ def test_get_version_container_tag(): assert get_container_version_tag("1.0.0") == "v1.0.0" assert get_container_version_tag("SNAPSHOT") == "master" assert get_container_version_tag("1.0.0-SNAPSHOT") == "openwrt-1.0.0" + assert get_container_version_tag("23.05.0-rc3") == "v23.05.0-rc3" def test_check_manifest():