From cb027ce2a9f3d1be747d3cb36402202172830eaf Mon Sep 17 00:00:00 2001 From: Joe Beda Date: Fri, 17 Oct 2014 14:34:30 -0700 Subject: [PATCH] Look at all tags when looking for version. 'git describe' uses only annotated tags by default. We want to use all tags as we can only create 'lightweight' tags in the GitHub UI. --- hack/config-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/config-go.sh b/hack/config-go.sh index d0b3479a77..80c56184ad 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -78,7 +78,7 @@ kube::version_ldflags() { ldflags+=(-X "${KUBE_GO_PACKAGE}/pkg/version.gitTreeState" "${KUBE_GIT_TREE_STATE}") # Use git describe to find the version based on annotated tags. - if [[ -n ${KUBE_GIT_VERSION-} ]] || KUBE_GIT_VERSION=$(git describe --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null); then + if [[ -n ${KUBE_GIT_VERSION-} ]] || KUBE_GIT_VERSION=$(git describe --tag --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null); then if [[ "${KUBE_GIT_TREE_STATE}" == "dirty" ]]; then # git describe --dirty only considers changes to existing files, but # that is problematic since new untracked .go files affect the build,