From edcd8e1449a14cce95286d225d9546a7280b1045 Mon Sep 17 00:00:00 2001 From: zryfish Date: Wed, 13 Oct 2021 17:40:54 +0800 Subject: [PATCH] fix gitMajor and gitMinor missing in version api (#4361) * fix version missing * suppress shellcheck warnings --- hack/lib/version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/lib/version.sh b/hack/lib/version.sh index e79766dd5..28d7fb597 100644 --- a/hack/lib/version.sh +++ b/hack/lib/version.sh @@ -80,7 +80,8 @@ kube::version::get_version_vars() { # 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]+)(\.[0-9]+)?([-].*)?([+].*)?$ ]]; then - # KUBE_GIT_MAJOR=${BASH_REMATCH[1]} + # shellcheck disable=SC2034 + KUBE_GIT_MAJOR=${BASH_REMATCH[1]} KUBE_GIT_MINOR=${BASH_REMATCH[2]} if [[ -n "${BASH_REMATCH[4]}" ]]; then KUBE_GIT_MINOR+="+"