1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

ci/run-kola: Support pull secret for running in Prow

This is needed to support fetching the image from the
registry.

Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Colin Walters
2022-12-16 10:23:15 -05:00
parent 1698b3c9f3
commit 6f4bfd5bf7

View File

@@ -9,12 +9,31 @@ if test -z "${TARGET_IMAGE:-}"; then
fi
echo "Test base image: ${TARGET_IMAGE}"
tmpdir="$(mktemp -d -p /var/tmp)"
cd "${tmpdir}"
# Detect Prow; if we find it, assume the image requires a pull secret
kola_args=()
if test -n "${JOB_NAME_HASH:-}"; then
oc registry login --to auth.json
cat > pull-secret.bu << 'EOF'
variant: fcos
version: 1.1.0
storage:
files:
- path: /etc/ostree/auth.json
contents:
local: auth.json
EOF
butane -d . < pull-secret.bu > pull-secret.ign
kola_args+=("--append-ignition" "pull-secret.ign")
fi
if test -z "${BASE_QEMU_IMAGE:-}"; then
coreos-installer download -p qemu -f qcow2.xz --decompress
BASE_QEMU_IMAGE="$(echo *.qcow2)"
fi
kola run --oscontainer ostree-unverified-registry:${TARGET_IMAGE} --qemu-image "./${BASE_QEMU_IMAGE}" ext.bootc.'*'
kola run --oscontainer ostree-unverified-registry:${TARGET_IMAGE} --qemu-image "./${BASE_QEMU_IMAGE}" "${kola_args[@]}" ext.bootc.'*'
echo "ok kola bootc"