From e2317311a763e3777a2fb482980b932803c7c602 Mon Sep 17 00:00:00 2001 From: Yuvaraj Kakaraparthi Date: Mon, 20 Sep 2021 13:42:32 -0700 Subject: [PATCH] use only annotated tags to calculate git version --- hack/version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/version.sh b/hack/version.sh index 66c156ed4f3f..7450f45294c9 100755 --- a/hack/version.sh +++ b/hack/version.sh @@ -28,8 +28,8 @@ version::get_version_vars() { fi # stolen from k8s.io/hack/lib/version.sh - # Use git describe to find the version based on tags. - if GIT_VERSION=$(git describe --tags --abbrev=14 2>/dev/null); then + # Use git describe to find the version based on annotated tags. + if GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then # This translates the "git describe" to an actual semver.org # compatible semantic version that looks something like this: # v1.1.0-alpha.0.6+84c76d1142ea4d