Skip to content

Commit 6b1d1cc

Browse files
committed
Allow users to use custom tags
When discovering the kube version we only consider tags that match the glob 'v*'. By doing so users can create/use their custom tags as long as they don't look like a version (starting with a 'v'). We already do a similar thing when building the pause container, see how the `REV` is set in git.k8s.io/kubernetes/build/pause/Makefile.
1 parent 3c0bc3c commit 6b1d1cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hack/lib/version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ kube::version::get_version_vars() {
6666
fi
6767

6868
# Use git describe to find the version based on tags.
69-
if [[ -n ${KUBE_GIT_VERSION-} ]] || KUBE_GIT_VERSION=$("${git[@]}" describe --tags --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null); then
69+
if [[ -n ${KUBE_GIT_VERSION-} ]] || KUBE_GIT_VERSION=$("${git[@]}" describe --tags --match='v*' --abbrev=14 "${KUBE_GIT_COMMIT}^{commit}" 2>/dev/null); then
7070
# This translates the "git describe" to an actual semver.org
7171
# compatible semantic version that looks something like this:
7272
# v1.1.0-alpha.0.6+84c76d1142ea4d

0 commit comments

Comments
 (0)