test: make run-builder.sh work with podman 4

RHEL is now shipping podman 4 that encodes the networks differently, let's
implement a small dirty hack to fix it on RHEL before
https://github.com/osbuild/koji-osbuild/pull/100 can land and fix it properly.
This commit is contained in:
Ondřej Budai 2022-06-29 15:30:16 +02:00 committed by Christian Kellner
parent 12773dbe25
commit 3930f277fc

View file

@ -22,7 +22,12 @@ else
fi
builder_start() {
GATEWAY_IP=$(${CONTAINER_RUNTIME} network inspect org.osbuild.koji | jq -r ".[0].plugins[0].ipam.ranges[0][0].gateway")
source /etc/os-release
if [[ $ID == rhel ]]; then
GATEWAY_IP=$(${CONTAINER_RUNTIME} network inspect org.osbuild.koji | jq -r ".[0].subnets[0].gateway")
else
GATEWAY_IP=$(${CONTAINER_RUNTIME} network inspect org.osbuild.koji | jq -r ".[0].plugins[0].ipam.ranges[0][0].gateway")
fi
echo "Gateway IP is $GATEWAY_IP"
# maybe copy the 'builder' plugin to the share dir