diff --git a/hack/version.sh b/hack/version.sh index 58037048..ea208410 100755 --- a/hack/version.sh +++ b/hack/version.sh @@ -33,7 +33,7 @@ version::get_version_vars() { # stolen from k8s.io/hack/lib/version.sh # Use git describe to find the version based on annotated tags. - if [[ -n ${GIT_VERSION-} ]] || GIT_VERSION=$(git describe --abbrev=14 --match "v[0-9]*" 2>/dev/null); then + if [[ -n ${GIT_VERSION-} ]] || GIT_VERSION=$(git describe --tags --abbrev=14 --match "v[0-9]*" "${GIT_COMMIT}" 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