From 98133503508e391bfd1095a11f95ffee2c73fa67 Mon Sep 17 00:00:00 2001 From: Guilherme Macedo Date: Wed, 8 Jan 2025 15:46:19 -0300 Subject: [PATCH] VEX related improvements in the build process Signed-off-by: Guilherme Macedo --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 37be270f..702dc7db 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,10 @@ $(SETUP_ENVTEST): .PHONY: operator operator: - CGO_ENABLED=0 go build -o bin/aks-operator main.go + CGO_ENABLED=0 go build -ldflags \ + "-X github.com/rancher/aks-operator/pkg/version.GitCommit=$(GIT_COMMIT) \ + -X github.com/rancher/aks-operator/pkg/version.Version=$(TAG)" \ + -o bin/aks-operator . .PHONY: generate-go generate-go: $(MOCKGEN) @@ -132,7 +135,7 @@ buildx-machine: .PHONY: image-build image-build: buildx-machine ## build (and load) the container image targeting the current platform. docker buildx build -f package/Dockerfile \ - --builder $(MACHINE) --build-arg VERSION=$(TAG) \ + --builder $(MACHINE) --build-arg COMMIT=$(GIT_COMMIT) --build-arg VERSION=$(TAG) \ -t "$(IMAGE)" $(BUILD_ACTION) . @echo "Built $(IMAGE)" @@ -181,4 +184,4 @@ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/release-v2.8) .PHONY: apidiff apidiff: $(GO_APIDIFF) ## Check for API differences - $(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible \ No newline at end of file + $(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible