@@ -12,19 +12,12 @@ QUERIES_CONFIG_DIR ?= hack/tools/queries
12
12
# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
13
13
BUILDAH_BUILD ?= buildah bud
14
14
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
19
17
GO_TEST ?= $(GO ) test
20
18
KUTTL ?= kubectl-kuttl
21
19
KUTTL_TEST ?= $(KUTTL ) test
22
20
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
-
28
21
# #@ General
29
22
30
23
# The help target prints out all targets with their descriptions organized
@@ -191,7 +184,8 @@ build-postgres-operator-image: build/postgres-operator/Dockerfile
191
184
# #@ Test
192
185
.PHONY : check
193
186
check : # # 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 ./...
195
189
196
190
# Available versions: curl -s 'https://storage.googleapis.com/kubebuilder-tools/' | grep -o '<Key>[^<]*</Key>'
197
191
# - KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT=true
@@ -206,7 +200,7 @@ check-envtest: get-pgmonitor
206
200
$(GO_TEST ) -count=1 -cover -tags=envtest ./...
207
201
208
202
# 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
210
204
# timeouts that are 20% longer than normal:
211
205
# make check-envtest-existing PGO_TEST_TIMEOUT_SCALE=1.2
212
206
.PHONY : check-envtest-existing
@@ -230,7 +224,7 @@ generate-kuttl: export KUTTL_PG_UPGRADE_FROM_VERSION ?= 15
230
224
generate-kuttl : export KUTTL_PG_UPGRADE_TO_VERSION ?= 16
231
225
generate-kuttl : export KUTTL_PG_VERSION ?= 16
232
226
generate-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
234
228
generate-kuttl : export KUTTL_TEST_DELETE_NAMESPACE ?= kuttl-test-delete-namespace
235
229
generate-kuttl : # # Generate kuttl tests
236
230
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
@@ -242,7 +236,6 @@ generate-kuttl: ## Generate kuttl tests
242
236
14 ) export KUTTL_BITNAMI_IMAGE_TAG=14.5.0-debian-11-r37 ;; \
243
237
13 ) export KUTTL_BITNAMI_IMAGE_TAG=13.8.0-debian-11-r39 ;; \
244
238
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 ;; \
246
239
esac ; \
247
240
render () { envsubst ' "' " ' \
248
241
$$ KUTTL_PG_UPGRADE_FROM_VERSION $$ KUTTL_PG_UPGRADE_TO_VERSION \
@@ -346,7 +339,6 @@ generate-cw-bundle:
346
339
$(KUSTOMIZE ) build ./config/cw-bundle/ > ./deploy/cw-bundle.yaml
347
340
348
341
349
-
350
342
# #@ Release
351
343
352
344
.PHONY : license licenses
@@ -380,17 +372,12 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
380
372
kustomize : # # Download kustomize locally if necessary.
381
373
$(call go-get-tool,$(KUSTOMIZE ) ,sigs.k8s.io/kustomize/kustomize/[email protected] )
382
374
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 :
391
378
$(call go-get-tool,$(ENVTEST ) ,sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
392
379
393
- build-docker-image :
380
+ build-docker-image : get-pgmonitor
394
381
ROOT_REPO=$(ROOT_REPO ) VERSION=$(VERSION ) IMAGE=$(IMAGE ) $(ROOT_REPO ) /e2e-tests/build
395
382
396
383
build-extension-installer-image :
0 commit comments