Skip to content

Commit 7afc14c

Browse files
Address review feedback
Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent f0fb04e commit 7afc14c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ 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-
300298
ifeq ($(origin CGO_ENABLED), undefined)
301299
CGO_ENABLED := 0
302300
endif
@@ -310,7 +308,7 @@ export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
310308
export GO_BUILD_FLAGS :=
311309
export GO_BUILD_LDFLAGS := -s -w \
312310
-X '$(VERSION_PATH).version=$(VERSION)' \
313-
-X "$(VERSION_PATH).gitCommit=$(GIT_COMMIT)" \
311+
-X '$(VERSION_PATH).gitCommit=$(GIT_COMMIT)' \
314312

315313
BINARIES=operator-controller catalogd
316314

internal/shared/version/version.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
)
77

88
var (
9-
gitCommit = "unknown"
9+
gitCommit = ""
1010
commitDate = "unknown"
1111
repoState = "unknown"
1212
version = "unknown"
@@ -29,7 +29,9 @@ func init() {
2929
for _, setting := range info.Settings {
3030
switch setting.Key {
3131
case "vcs.revision":
32-
gitCommit = setting.Value
32+
if gitCommit == "" {
33+
gitCommit = setting.Value
34+
}
3335
case "vcs.time":
3436
commitDate = setting.Value
3537
case "vcs.modified":

0 commit comments

Comments
 (0)