Skip to content

Commit 47f389a

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

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
@@ -295,6 +295,8 @@ VERSION := $(shell git describe --tags --always --dirty)
295295
endif
296296
export VERSION
297297

298+
GIT_COMMIT := $(if $(SOURCE_GIT_COMMIT),$(SOURCE_GIT_COMMIT),$(shell git rev-parse HEAD))
299+
298300
ifeq ($(origin CGO_ENABLED), undefined)
299301
CGO_ENABLED := 0
300302
endif
@@ -308,6 +310,7 @@ export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
308310
export GO_BUILD_FLAGS :=
309311
export GO_BUILD_LDFLAGS := -s -w \
310312
-X '$(VERSION_PATH).version=$(VERSION)' \
313+
-X "$(VERSION_PATH).gitCommit=$(GIT_COMMIT)" \
311314

312315
BINARIES=operator-controller catalogd
313316

0 commit comments

Comments
 (0)