Skip to content

Commit 9232df5

Browse files
committed
Fix minionversion regex to allow Linux build suffix (e.g. 3004.2-1)
Pre-3005 Linux Salt packages used a -N build suffix in their version strings. The CalVer regex only allowed rc suffixes, causing _validate_minion_version_param to reject 3004.2-1 and 3003.3-1 with exit 126 and breaking existing CI tests that rely on those versions defaulting to latest. Adds (-[0-9]+) as an alternative to (rc[0-9]+) in the Linux validator only — Windows packages were not released with this suffix format.
1 parent 0d05c3f commit 9232df5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

linux/svtminion.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,8 +1990,8 @@ _validate_source_param() {
19901990
# Validates the --minionversion parameter value. Exits with scriptFailed
19911991
# (126) if the value does not match the expected Salt CalVer format.
19921992
#
1993-
# Valid: latest, YYYY, YYYY.N, YYYY.N.N, YYYY.NrcN (e.g. 3006, 3006.2,
1994-
# 3008.0, 3008.0rc1)
1993+
# Valid: latest, YYYY, YYYY.N, YYYY.N.N, YYYY.NrcN, YYYY.N.N-N
1994+
# (e.g. 3006, 3006.2, 3008.0, 3008.0rc1, 3004.2-1)
19951995
#
19961996
# Input:
19971997
# $1 raw MINION_VERSION_PARAMS string (first word is extracted)
@@ -2005,7 +2005,7 @@ _validate_minion_version_param() {
20052005
local version_val="$1"
20062006

20072007
if ! echo "${version_val}" | \
2008-
grep -qE '^(latest|[0-9]{4}(\.[0-9]+(\.[0-9]+)*(rc[0-9]+)?)?)$'; then
2008+
grep -qE '^(latest|[0-9]{4}(\.[0-9]+(\.[0-9]+)*(rc[0-9]+|-[0-9]+)?)?)$'; then
20092009
_error_log "$0:${FUNCNAME[0]} Invalid --minionversion: '${version_val}'. "\
20102010
"Must be 'latest', a major version (e.g. 3006), "\
20112011
"or a full version (e.g. 3006.2, 3008.0rc1)"

0 commit comments

Comments
 (0)