1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Merge pull request #1980 from marquiz/backports/0.16

[release-0.16] Fix version parsing
This commit is contained in:
Kubernetes Prow Robot 2024-12-13 12:22:26 +01:00 committed by GitHub
commit 725c20496e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 9 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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