diff --git a/Makefile b/Makefile index aba3d239..8e254b36 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,11 @@ IMAGE_TAG ?= latest else IMAGE_TAG ?= v$(VERSION) endif +# kubebuilder-tools still doesn't support darwin/arm64. This is a workaround (https://github.com/kubernetes-sigs/controller-runtime/issues/1657) +ARCH_PARAM = +ifeq ($(shell uname -sm),Darwin arm64) + ARCH_PARAM = --arch=amd64 +endif # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) @@ -104,7 +109,7 @@ vet: ## Run go vet against code. go vet ./... test: manifests generate fmt vet envtest ## Run tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) $(ARCH_PARAM) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out ##@ Build