From 373cf77ae1039cac09b79fde1ef98697c70b7433 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 2 Dec 2014 21:23:35 -0800 Subject: [PATCH] Adjust the regexp so that we can handle extra sub versions. --- hack/lib/version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/lib/version.sh b/hack/lib/version.sh index f3c5289f9e6..e9124d1abfb 100644 --- a/hack/lib/version.sh +++ b/hack/lib/version.sh @@ -60,10 +60,10 @@ kube::version::get_version_vars() { # Try to match the "git describe" output to a regex to try to extract # the "major" and "minor" versions and whether this is the exact tagged # version or whether the tree is between two tagged versions. - if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)([.-].*)?$ ]]; then + if [[ "${KUBE_GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?([-].*)?$ ]]; then KUBE_GIT_MAJOR=${BASH_REMATCH[1]} KUBE_GIT_MINOR=${BASH_REMATCH[2]} - if [[ -n "${BASH_REMATCH[3]}" ]]; then + if [[ -n "${BASH_REMATCH[4]}" ]]; then KUBE_GIT_MINOR+="+" fi fi