Several fixes for building

- use go1.22 in teh test image
 - move controller image build out of the docker stanza so its fast
 - bump controller-gen version to 0.14.0

Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka
2024-07-11 17:10:45 +02:00
parent 24191220d4
commit 4f07893b82
5 changed files with 12 additions and 8 deletions

1
.earthlyignore Normal file
View File

@@ -0,0 +1 @@
bin/

1
.gitignore vendored
View File

@@ -24,3 +24,4 @@ testbin/*
*~
/helm-chart
build/

View File

@@ -76,7 +76,7 @@ luet:
e2e-tests-image:
FROM opensuse/tumbleweed
RUN zypper in -y go git qemu-x86 qemu-arm qemu-tools swtpm docker jq docker-compose make glibc libopenssl-devel curl gettext-runtime
RUN zypper in -y go1.22 git qemu-x86 qemu-arm qemu-tools swtpm docker jq docker-compose make glibc libopenssl-devel curl gettext-runtime awk envsubst
ENV GOPATH="/go"
COPY . /test
@@ -94,11 +94,15 @@ e2e-tests-image:
RUN luet repo add -y kairos --url quay.io/kairos/packages --type docker
RUN LUET_NOLOCK=true luet install -y container/kubectl utils/k3d
controller-latest:
FROM DOCKERFILE .
SAVE IMAGE controller:latest
e2e-tests:
FROM +e2e-tests-image
ARG LABEL
WITH DOCKER --allow-privileged
RUN make test # This also generates the latest controllers automatically, we do that before building the docker image with them
WITH DOCKER --allow-privileged --load controller:latest=+controller-latest
RUN ./scripts/e2e-tests.sh
END

View File

@@ -160,7 +160,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
CONTROLLER_TOOLS_VERSION ?= v0.14.0
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize

View File

@@ -34,10 +34,8 @@ trap cleanup EXIT
k3d cluster create "$CLUSTER_NAME" --k3s-arg "--cluster-cidr=10.49.0.1/16@server:0" --k3s-arg "--service-cidr=10.48.0.1/16@server:0" -p '80:80@server:0' -p '443:443@server:0' --image "$K3S_IMAGE"
k3d kubeconfig get "$CLUSTER_NAME" > "$KUBECONFIG"
# Build the docker image
IMG=controller:latest make docker-build
# Import the image to the cluster
# Import the controller image that we built at the start into to the cluster
# this image has to exists and be available in the local docker
k3d image import -c "$CLUSTER_NAME" controller:latest
# Install cert manager