@@ -79,7 +79,7 @@ kind-load:
79
79
80
80
.PHONY : unit-test
81
81
unit-test : manifests generate fmt vet envtest # # Run unit tests
82
- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) -p path) " go test -v -timeout 1800s -p 1 ./internal/controllers/... -ginkgo.v -coverprofile cover.out
82
+ KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use --arch=amd64 $( ENVTEST_K8S_VERSION) -p path) " go test -v -timeout 1800s -p 1 ./internal/controllers/... -ginkgo.v -coverprofile cover.out
83
83
84
84
.PHONY : e2e-test
85
85
e2e-test : manifests generate fmt vet docker-build kind-init kind-load # # Run e2e tests
@@ -104,12 +104,17 @@ docker-push: ## Push docker image with the manager.
104
104
docker push ${IMG}
105
105
106
106
CONTROLLER_GEN = $(shell pwd) /bin/controller-gen
107
+ CONTROLLER_GEN_VERSION ?= v0.6.1
107
108
controller-gen : # # Download controller-gen locally if necessary.
108
- $(call go-get-tool,$(CONTROLLER_GEN ) ,sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1 )
109
+ $(call go-get-tool,$(CONTROLLER_GEN ) ,sigs.k8s.io/controller-tools/cmd/controller-gen@$( CONTROLLER_GEN_VERSION ) )
109
110
111
+ # ENVTEST_VERSION is usually latest, but might need to be pinned from time to time.
112
+ # Version pinning is needed due to version incompatibility between controller-runtime and setup-envtest.
113
+ # For more information: https://github.com/kubernetes-sigs/controller-runtime/issues/2744
110
114
ENVTEST = $(shell pwd) /bin/setup-envtest
115
+ ENVTEST_VERSION ?= release-0.16
111
116
envtest : # # Download envtest-setup locally if necessary.
112
- $(call go-get-tool,$(ENVTEST ) ,sigs.k8s.io/controller-runtime/tools/setup-envtest@latest )
117
+ $(call go-get-tool,$(ENVTEST ) ,sigs.k8s.io/controller-runtime/tools/setup-envtest@$( ENVTEST_VERSION ) )
113
118
114
119
# go-get-tool will 'go install' any package $2 and install it to $1.
115
120
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
0 commit comments