Skip to content

Commit 1ecb1c7

Browse files
authored
Merge pull request #1977 from marquiz/devel/fix-version-parsing
Fix version parsing
2 parents 1416072 + 047d031 commit 1ecb1c7

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

cmd/nfd-gc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func main() {
4747

4848
// Assert that the version is known
4949
if version.Undefined() {
50-
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.")
50+
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.")
5151
}
5252

5353
// Get new garbage collector instance

cmd/nfd-master/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func main() {
8383

8484
// Assert that the version is known
8585
if version.Undefined() {
86-
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.")
86+
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.")
8787
}
8888

8989
// Plug klog into grpc logging infrastructure

cmd/nfd-topology-updater/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func main() {
4949

5050
// Assert that the version is known
5151
if version.Undefined() {
52-
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.")
52+
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.")
5353
}
5454

5555
// Plug klog into grpc logging infrastructure

cmd/nfd-worker/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func main() {
5656

5757
// Assert that the version is known
5858
if version.Undefined() {
59-
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.")
59+
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.")
6060
}
6161

6262
// Plug klog into grpc logging infrastructure

scripts/github/update-gh-pages.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ if [ "$site_subdir" != "master" ]; then
111111
;;
112112
*)
113113
echo "Not a released version. Parsed release branch is $site_subdir but based on tag $_base_tag. Stopping here."
114-
echo "SHA `git describe` (`git rev-parse HEAD`)"
114+
echo "SHA `git describe` (`git rev-parse --match 'v*' HEAD`)"
115115
exit 0
116116
;;
117117
esac
@@ -130,7 +130,7 @@ make site-build
130130
if [ -n "$_GIT_TAG" ]; then
131131
commit_hash=${GIT_TAG:10}
132132
else
133-
commit_hash=`git describe --tags --dirty --always`
133+
commit_hash=`git describe --tags --dirty --always --match "v*"`
134134
fi
135135

136136
# Sync OWNERS file from master branch

scripts/test-infra/test-e2e-presubmit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export KIND_NODE_IMAGE="kindest/node:v1.30.2"
77
export CLUSTER_NAME="nfd-e2e"
88
export KUBECONFIG="/tmp/kubeconfig_$CLUSTER_NAME"
99
export IMAGE_REPO="registry.local/node-feature-discovery"
10-
export IMAGE_TAG_NAME=$(git describe --tags --dirty --always)
10+
export IMAGE_TAG_NAME=$(git describe --tags --dirty --always --match "v*")
1111

1212
# Install kind
1313
go install sigs.k8s.io/kind@$KIND_VERSION

0 commit comments

Comments
 (0)