Skip to content

Commit

Permalink
Merge pull request #1980 from marquiz/backports/0.16
Browse files Browse the repository at this point in the history
[release-0.16] Fix version parsing
  • Loading branch information
k8s-ci-robot authored Dec 13, 2024
2 parents e2dbd2c + f99c1dd commit 725c204
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nfd-gc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/nfd-master/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/nfd-topology-updater/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/nfd-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/github/update-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-infra/test-e2e-presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 725c204

Please sign in to comment.