Skip to content

Commit ad27502

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

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
@@ -308,8 +308,6 @@ VERSION := $(shell git describe --tags --always --dirty)
308308
endif
309309
export VERSION
310310

311-
GIT_COMMIT := $(if $(SOURCE_GIT_COMMIT),$(SOURCE_GIT_COMMIT),$(shell git rev-parse HEAD))
312-
313311
ifeq ($(origin CGO_ENABLED), undefined)
314312
CGO_ENABLED := 0
315313
endif
@@ -323,7 +321,7 @@ export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
323321
export GO_BUILD_FLAGS :=
324322
export GO_BUILD_LDFLAGS := -s -w \
325323
-X '$(VERSION_PATH).version=$(VERSION)' \
326-
-X "$(VERSION_PATH).gitCommit=$(GIT_COMMIT)" \
324+
-X '$(VERSION_PATH).gitCommit=$(GIT_COMMIT)' \
327325

328326
BINARIES=operator-controller catalogd
329327

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)