diff --git a/Makefile b/Makefile index 7132d3beb9..27a870aa6b 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ SITE_BASEURL ?= SITE_DESTDIR ?= _site JEKYLL_OPTS := -d '$(SITE_DESTDIR)' $(if $(SITE_BASEURL),-b '$(SITE_BASEURL)',) -VERSION := $(shell git describe --tags --dirty --always) +VERSION := $(shell git describe --tags --dirty --always --match "v*") IMAGE_REGISTRY ?= registry.k8s.io/nfd IMAGE_TAG_NAME ?= $(VERSION) diff --git a/cmd/nfd-gc/main.go b/cmd/nfd-gc/main.go index 6093ac7612..799185514f 100644 --- a/cmd/nfd-gc/main.go +++ b/cmd/nfd-gc/main.go @@ -47,7 +47,7 @@ func main() { // Assert that the version is known if version.Undefined() { - klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always`\" during build or run.") + klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.") } // Get new garbage collector instance diff --git a/cmd/nfd-master/main.go b/cmd/nfd-master/main.go index bfc781a8fb..56c60ec64c 100644 --- a/cmd/nfd-master/main.go +++ b/cmd/nfd-master/main.go @@ -102,7 +102,7 @@ func main() { // Assert that the version is known if version.Undefined() { - klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always`\" during build or run.") + klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.") } // Plug klog into grpc logging infrastructure diff --git a/cmd/nfd-topology-updater/main.go b/cmd/nfd-topology-updater/main.go index dc6bee50df..89fe8c57ec 100644 --- a/cmd/nfd-topology-updater/main.go +++ b/cmd/nfd-topology-updater/main.go @@ -49,7 +49,7 @@ func main() { // Assert that the version is known if version.Undefined() { - klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always`\" during build or run.") + klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.") } // Plug klog into grpc logging infrastructure diff --git a/cmd/nfd-worker/main.go b/cmd/nfd-worker/main.go index 83ff124453..cdbdc478d7 100644 --- a/cmd/nfd-worker/main.go +++ b/cmd/nfd-worker/main.go @@ -56,7 +56,7 @@ func main() { // Assert that the version is known if version.Undefined() { - klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always`\" during build or run.") + klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.") } // Check deprecated flags diff --git a/scripts/github/update-gh-pages.sh b/scripts/github/update-gh-pages.sh index 94d53a4522..f3e3ba553d 100755 --- a/scripts/github/update-gh-pages.sh +++ b/scripts/github/update-gh-pages.sh @@ -105,13 +105,13 @@ site_subdir=${site_subdir:-master} # Check if this ref is for a released version if [ "$site_subdir" != "master" ]; then - _base_tag=`git describe --abbrev=0 || :` + _base_tag=`git describe --abbrev=0 --match "v*" || :` case "$_base_tag" in $site_subdir*) ;; *) echo "Not a released version. Parsed release branch is $site_subdir but based on tag $_base_tag. Stopping here." - echo "SHA `git describe` (`git rev-parse HEAD`)" + echo "SHA `git describe` (`git rev-parse --match 'v*' HEAD`)" exit 0 ;; esac @@ -130,7 +130,7 @@ make site-build if [ -n "$_GIT_TAG" ]; then commit_hash=${GIT_TAG:10} else - commit_hash=`git describe --tags --dirty --always` + commit_hash=`git describe --tags --dirty --always --match "v*"` fi # Sync OWNERS file from master branch diff --git a/scripts/test-infra/test-e2e-presubmit.sh b/scripts/test-infra/test-e2e-presubmit.sh index 6905d148fe..dd10fa8d2a 100755 --- a/scripts/test-infra/test-e2e-presubmit.sh +++ b/scripts/test-infra/test-e2e-presubmit.sh @@ -4,7 +4,7 @@ set -o pipefail # Configure environment KIND_IMAGE="kindest/node:v1.25.3" export IMAGE_REGISTRY="localhost:5001" -export CLUSTER_NAME=$(git describe --tags --dirty --always) +export CLUSTER_NAME=$(git describe --tags --dirty --always --match "v*") export KUBECONFIG="/tmp/kubeconfig_$CLUSTER_NAME" # create registry container unless it already exists