Skip to content

Commit 32c6671

Browse files
ronenscopenshift-merge-bot[bot]
authored andcommitted
Log MCAD and InstaScale versions
1 parent 6d4a5cd commit 32c6671

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ modules: ## Update Go dependencies.
159159

160160
.PHONY: build
161161
build: modules fmt vet ## Build manager binary.
162-
go build -ldflags "-X 'main.BuildVersion=$(BUILD_VERSION)' -X 'main.BuildDate=$(BUILD_DATE)'" -o bin/manager main.go
162+
go build \
163+
-ldflags " \
164+
-X 'main.OperatorVersion=$(BUILD_VERSION)' \
165+
-X 'main.McadVersion=$(MCAD_VERSION)' \
166+
-X 'main.InstaScaleVersion=$(INSTASCALE_VERSION)' \
167+
-X 'main.BuildDate=$(BUILD_DATE)' \
168+
" \
169+
-o bin/manager main.go
163170

164171
.PHONY: run
165172
run: modules manifests fmt vet ## Run a controller from your host.

main.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ import (
5858
)
5959

6060
var (
61-
scheme = runtime.NewScheme()
62-
setupLog = ctrl.Log.WithName("setup")
63-
BuildVersion = "UNKNOWN"
64-
BuildDate = "UNKNOWN"
61+
scheme = runtime.NewScheme()
62+
setupLog = ctrl.Log.WithName("setup")
63+
OperatorVersion = "UNKNOWN"
64+
McadVersion = "UNKNOWN"
65+
InstaScaleVersion = "UNKNOWN"
66+
BuildDate = "UNKNOWN"
6567
)
6668

6769
func init() {
@@ -87,7 +89,12 @@ func main() {
8789
zapOptions.BindFlags(flag.CommandLine)
8890

8991
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&zapOptions)))
90-
setupLog.Info("Build info", "version", BuildVersion, "date", BuildDate)
92+
setupLog.Info("Build info",
93+
"operatorVersion", OperatorVersion,
94+
"mcadVersion", McadVersion,
95+
"instaScaleVersion", InstaScaleVersion,
96+
"date", BuildDate,
97+
)
9198

9299
ctx := ctrl.SetupSignalHandler()
93100

0 commit comments

Comments
 (0)