Skip to content

Commit 7fc18c6

Browse files
🐛bugfix for operator-controller not outputting the right commit ID in the version (#1811)
* bugfix for operator-controller not outputting the right commit ID in version Signed-off-by: Rashmi Gottipati <[email protected]> * Address review feedback Signed-off-by: Rashmi Gottipati <[email protected]> * leave default as it is` Signed-off-by: Rashmi Gottipati <[email protected]> --------- Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent 04a2b45 commit 7fc18c6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
321321
export GO_BUILD_FLAGS :=
322322
export GO_BUILD_LDFLAGS := -s -w \
323323
-X '$(VERSION_PATH).version=$(VERSION)' \
324+
-X '$(VERSION_PATH).gitCommit=$(GIT_COMMIT)' \
324325

325326
BINARIES=operator-controller catalogd
326327

internal/shared/version/version.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -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 == "unknown" {
33+
gitCommit = setting.Value
34+
}
3335
case "vcs.time":
3436
commitDate = setting.Value
3537
case "vcs.modified":

0 commit comments

Comments
 (0)