test: optimise disk usage (#2012)

* test: optimise disk usage

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: change tag

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: use create to build testing buildah image

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup: install crane

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
Matej Vasek 2023-10-20 19:48:59 +02:00 committed by GitHub
parent b24688723e
commit 6c6730f324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

BIN
hack/allow-insecure.tar Normal file

Binary file not shown.

View File

@ -11,8 +11,9 @@ ko build --tags "latest" -B ./cmd/func
# Build custom buildah image for tests.
# This image will accept registries ending with .cluster.local as insecure (non-TLS).
docker build . -f - -t localhost:50000/buildah/stable:v1.31.0 <<EOF
FROM quay.io/buildah/stable:v1.31.0
RUN echo -e '\n[[registry]]\nprefix = "*.cluster.local"\ninsecure = true' >> '/etc/containers/registries.conf'
EOF
docker push localhost:50000/buildah/stable:v1.31.0
go install github.com/google/go-containerregistry/cmd/crane@latest
crane append --base=quay.io/buildah/stable:v1.31.0 \
--new_layer="$(dirname "$0")/allow-insecure.tar" \
--new_tag=quay.io/buildah/stable:v1.31.0 \
--output=/dev/stdout | \
docker exec -i func-control-plane ctr -n=k8s.io images import -