Skip to content

Commit e4e69b2

Browse files
author
OpenShift Bot
authored
Merge pull request #12690 from stevekuznetsov/skuznets/better-version-regex
Merged by openshift-bot
2 parents 83e2ef6 + d00771e commit e4e69b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hack/common.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ function os::build::os_version_vars() {
578578
# Try to match the "git describe" output to a regex to try to extract
579579
# the "major" and "minor" versions and whether this is the exact tagged
580580
# version or whether the tree is between two tagged versions.
581-
if [[ "${OS_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?$ ]]; then
581+
if [[ "${OS_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)+?([-].*)?$ ]]; then
582582
OS_GIT_MAJOR=${BASH_REMATCH[1]}
583583
OS_GIT_MINOR=${BASH_REMATCH[2]}
584584
if [[ -n "${BASH_REMATCH[4]}" ]]; then
@@ -626,7 +626,7 @@ function os::build::kube_version_vars() {
626626
# Try to match the "git describe" output to a regex to try to extract
627627
# the "major" and "minor" versions and whether this is the exact tagged
628628
# version or whether the tree is between two tagged versions.
629-
if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?$ ]]; then
629+
if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)+?([-].*)?$ ]]; then
630630
KUBE_GIT_MAJOR=${BASH_REMATCH[1]}
631631
KUBE_GIT_MINOR=${BASH_REMATCH[2]}
632632
if [[ -n "${BASH_REMATCH[4]}" ]]; then

0 commit comments

Comments
 (0)