@@ -12,19 +12,12 @@ QUERIES_CONFIG_DIR ?= hack/tools/queries
1212# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
1313BUILDAH_BUILD ?= buildah bud
1414
15- DEBUG_BUILD ?= false
16- GO ?= go
17- GO_BUILD = $(GO_CMD ) build -trimpath
18- GO_CMD = $(GO_ENV ) $(GO )
15+ GO ?= CGO_ENABLED=1 go
16+ GO_BUILD = $(GO ) build -trimpath
1917GO_TEST ?= $(GO ) test
2018KUTTL ?= kubectl-kuttl
2119KUTTL_TEST ?= $(KUTTL ) test
2220
23- # Disable optimizations if creating a debug build
24- ifeq ("$(DEBUG_BUILD ) ", "true")
25- GO_BUILD = $(GO_CMD) build -gcflags='all=-N -l'
26- endif
27-
2821# #@ General
2922
3023# The help target prints out all targets with their descriptions organized
@@ -191,7 +184,8 @@ build-postgres-operator-image: build/postgres-operator/Dockerfile
191184# #@ Test
192185.PHONY : check
193186check : # # Run basic go tests with coverage output
194- $(GO_TEST ) -cover ./...
187+ check : get-pgmonitor
188+ QUERIES_CONFIG_DIR=" $( CURDIR) /${QUERIES_CONFIG_DIR} " $(GO_TEST ) -cover ./...
195189
196190# Available versions: curl -s 'https://storage.googleapis.com/kubebuilder-tools/' | grep -o '<Key>[^<]*</Key>'
197191# - KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true
@@ -206,7 +200,7 @@ check-envtest: get-pgmonitor
206200 $(GO_TEST ) -count=1 -cover -tags=envtest ./...
207201
208202# The "PGO_TEST_TIMEOUT_SCALE" environment variable (default: 1) can be set to a
209- # positive number that extends test timeouts. The following runs tests with
203+ # positive number that extends test timeouts. The following runs tests with
210204# timeouts that are 20% longer than normal:
211205# make check-envtest-existing PGO_TEST_TIMEOUT_SCALE=1.2
212206.PHONY : check-envtest-existing
@@ -230,7 +224,7 @@ generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 15
230224generate-kuttl : export KUTTL_PG_UPGRADE_TO_VERSION ?= 16
231225generate-kuttl : export KUTTL_PG_VERSION ?= 16
232226generate-kuttl : export KUTTL_POSTGIS_VERSION ?= 3.4
233- generate-kuttl : export KUTTL_PSQL_IMAGE ?= registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.2-0
227+ generate-kuttl : export KUTTL_PSQL_IMAGE ?= registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1
234228generate-kuttl : export KUTTL_TEST_DELETE_NAMESPACE ?= kuttl-test-delete-namespace
235229generate-kuttl : # # Generate kuttl tests
236230 [ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
@@ -242,7 +236,6 @@ generate-kuttl: ## Generate kuttl tests
242236 14 ) export KUTTL_BITNAMI_IMAGE_TAG=14.5.0-debian-11-r37 ;; \
243237 13 ) export KUTTL_BITNAMI_IMAGE_TAG=13.8.0-debian-11-r39 ;; \
244238 12 ) export KUTTL_BITNAMI_IMAGE_TAG=12.12.0-debian-11-r40 ;; \
245- 11 ) export KUTTL_BITNAMI_IMAGE_TAG=11.17.0-debian-11-r39 ;; \
246239 esac ; \
247240 render () { envsubst ' "' " ' \
248241 $$ KUTTL_PG_UPGRADE_FROM_VERSION $$ KUTTL_PG_UPGRADE_TO_VERSION \
@@ -346,7 +339,6 @@ generate-cw-bundle:
346339 $(KUSTOMIZE ) build ./config/cw-bundle/ > ./deploy/cw-bundle.yaml
347340
348341
349-
350342# #@ Release
351343
352344.PHONY : license licenses
@@ -380,17 +372,12 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
380372kustomize : # # Download kustomize locally if necessary.
381373 $(call go-get-tool,$(KUSTOMIZE ) ,sigs.k8s.io/kustomize/kustomize/v4@v4.5.3)
382374
383- # Available versions: curl -s 'https://storage.googleapis.com/kubebuilder-tools/' | grep -o '<Key>[^<]*</Key>'
384- # - ENVTEST_K8S_VERSION=1.19.2
385- hack/tools/envtest : SHELL = bash
386- hack/tools/envtest :
387- source ' $(shell $(GO) list -f ' {{ .Dir }}' -m ' sigs.k8s.io/controller-runtime' )/hack/setup-envtest.sh' && fetch_envtest_tools $@
388-
389- ENVTEST = $(shell pwd) /bin/setup-envtest
390- envtest : # # Download envtest-setup locally if necessary.
375+ ENVTEST ?= hack/tools/setup-envtest
376+ tools : tools/setup-envtest
377+ tools/setup-envtest :
391378 $(call go-get-tool,$(ENVTEST ) ,sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
392379
393- build-docker-image :
380+ build-docker-image : get-pgmonitor
394381 ROOT_REPO=$(ROOT_REPO ) VERSION=$(VERSION ) IMAGE=$(IMAGE ) $(ROOT_REPO ) /e2e-tests/build
395382
396383build-extension-installer-image :
0 commit comments