From 4313acf4c768f80b87c7b3157cc0873789134b32 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 8 Jul 2024 16:20:41 +0400 Subject: [PATCH] fix: make the version -34-g... optional Make sure validation works for tagged versions. Signed-off-by: Andrey Smirnov --- cmd/extensions-validator/cmd/validate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/extensions-validator/cmd/validate.go b/cmd/extensions-validator/cmd/validate.go index 0714b8a..aa38c99 100644 --- a/cmd/extensions-validator/cmd/validate.go +++ b/cmd/extensions-validator/cmd/validate.go @@ -39,12 +39,12 @@ var ( // Eg: // 535.129.03-v1.8.0-alpha.0-10-g336fa0f-dirty // 535.129.03-v1.8.0-alpha.0-10-g336fa0f - buildArgRegex = regexp.MustCompile(`^(\d+\.\d+\.\d+)-v(\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)-(\d+)-g([0-9a-f]+)(-dirty)?$`) + buildArgRegex = regexp.MustCompile(`^(\d+\.\d+\.\d+)-v(\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)(-(\d+)-g([0-9a-f]+)(-dirty)?)?$`) // commitBuildArgRegex is a regex to match a commit build arg version. // Eg: // 5815ee3-v1.8.0-alpha.0-10-g336fa0f-dirty // 5815ee3-v1.8.0-alpha.0-10-g336fa0f - commitBuildArgRegex = regexp.MustCompile(`^([0-9a-f]+)-v(\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)-(\d+)-g([0-9a-f]+)(-dirty)?$`) + commitBuildArgRegex = regexp.MustCompile(`^([0-9a-f]+)-v(\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?)(-(\d+)-g([0-9a-f]+)(-dirty)?)?$`) // partialSemverRegex is a regex to match a partial semver version. // Eg: // v4.3