From acc23426ba3e8e589e4405906a5bf0cb416522e7 Mon Sep 17 00:00:00 2001 From: Igor Karpukhin Date: Tue, 19 Apr 2022 12:58:14 +0200 Subject: [PATCH 1/2] Fixed PRODUCT_VERSION for the manager --- Makefile | 5 ++++- cmd/manager/main.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 734ea423ab..dab00fa060 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ SHELL := /usr/bin/env bash # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) VERSION ?= 0.8.0 +ifndef PRODUCT_VERSION +PRODUCT_VERSION := $(shell git describe --tags --dirty --broken) +endif + # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: @@ -85,7 +89,6 @@ e2e: run-kind ## Run e2e test. Command `make e2e label=cluster-ns` run cluster-n ./scripts/e2e_local.sh $(label) $(build) .PHONY: manager -manager: export PRODUCT_VERSION=$(shell git describe --tags --dirty --broken) manager: generate fmt vet ## Build manager binary go build -o bin/manager -ldflags="-X main.version=$(PRODUCT_VERSION)" cmd/manager/main.go diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 664554456a..1522aeaea0 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -83,7 +83,7 @@ func main() { os.Exit(1) } - logger.Info("starting with configuration", zap.Any("config", config)) + logger.Info("starting with configuration", zap.Any("config", config), zap.Any("version", atlas.ProductVersion)) ctrl.SetLogger(zapr.NewLogger(logger)) From a773ea99cc9a6f8d84b94e2a585a8c8dd2832f5f Mon Sep 17 00:00:00 2001 From: Igor Karpukhin Date: Wed, 20 Apr 2022 16:21:15 +0200 Subject: [PATCH 2/2] Fixed broken clusterwide test --- test/int/clusterwide/integration_suite_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/int/clusterwide/integration_suite_test.go b/test/int/clusterwide/integration_suite_test.go index 3e8d2de7b7..9fcd6944b9 100644 --- a/test/int/clusterwide/integration_suite_test.go +++ b/test/int/clusterwide/integration_suite_test.go @@ -177,7 +177,7 @@ func prepareAtlasClient() (*mongodbatlas.Client, atlas.Connection) { withDigest := httputil.Digest(publicKey, privateKey) httpClient, err := httputil.DecorateClient(&http.Client{Transport: http.DefaultTransport}, withDigest) Expect(err).ToNot(HaveOccurred()) - aClient, err := mongodbatlas.New(httpClient, mongodbatlas.SetBaseURL(atlasDomain+"/api/atlas/v1.0/")) + aClient, err := mongodbatlas.New(httpClient, mongodbatlas.SetBaseURL(atlasDomain)) Expect(err).ToNot(HaveOccurred()) return aClient, atlas.Connection{