Skip to content

Commit 0cb7ec3

Browse files
bugfix for operator-controller not outputting the right commit ID in version
Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent dd4f780 commit 0cb7ec3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ VERSION := $(shell git describe --tags --always --dirty)
290290
endif
291291
export VERSION
292292

293+
GIT_COMMIT := $(if $(SOURCE_GIT_COMMIT),$(SOURCE_GIT_COMMIT),$(shell git rev-parse HEAD))
294+
293295
ifeq ($(origin CGO_ENABLED), undefined)
294296
CGO_ENABLED := 0
295297
endif
@@ -303,6 +305,7 @@ export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
303305
export GO_BUILD_FLAGS :=
304306
export GO_BUILD_LDFLAGS := -s -w \
305307
-X '$(VERSION_PATH).version=$(VERSION)' \
308+
-X "$(VERSION_PATH).gitCommit=$(GIT_COMMIT)" \
306309

307310
BINARIES=operator-controller
308311

0 commit comments

Comments
 (0)