cert-manager-webhook-porkbun/Makefile
Marko Vukovic 6a1a4b9526 Enable test execution on arm64
Kubebuilder tools version 1.21.2 previously used does not work on arm64
(specifically Raspberry PI). Interestingly, the latest (as of the time
of this commit) version 1.24.2 does not work either. An error message
like this causes the test to fail:

apiserver.go:43: failed to start control plane: unable to start control plane itself: failed to start the controlplane. retried 5 times: timeout waiting for process kube-apiserver to start

However, with 1.24.1 the test "mostly" passes, although it may
occasionally fail. It might be that Raspberry PI is too slow and
something times out.

Signed-off-by: Marko Vukovic <anonsoftware@gmail.com>
2022-07-28 10:03:12 -07:00

41 lines
1 KiB
Makefile

OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH)
IMAGE_NAME := "webhook"
IMAGE_TAG := "latest"
OUT := $(shell pwd)/_out
KUBE_VERSION=1.24.1
$(shell mkdir -p "$(OUT)")
export TEST_ASSET_ETCD=_test/kubebuilder/bin/etcd
export TEST_ASSET_KUBE_APISERVER=_test/kubebuilder/bin/kube-apiserver
export TEST_ASSET_KUBECTL=_test/kubebuilder/bin/kubectl
test: _test/kubebuilder
go test -v .
_test/kubebuilder:
curl -fsSL https://go.kubebuilder.io/test-tools/$(KUBE_VERSION)/$(OS)/$(ARCH) -o kubebuilder-tools.tar.gz
mkdir -p _test/kubebuilder
tar -xvf kubebuilder-tools.tar.gz
mv kubebuilder/bin _test/kubebuilder/
rm kubebuilder-tools.tar.gz
rm -R kubebuilder
clean: clean-kubebuilder
clean-kubebuilder:
rm -Rf _test/kubebuilder
build:
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
.PHONY: rendered-manifest.yaml
rendered-manifest.yaml:
helm template \
--name example-webhook \
--set image.repository=$(IMAGE_NAME) \
--set image.tag=$(IMAGE_TAG) \
deploy/example-webhook > "$(OUT)/rendered-manifest.yaml"