diff --git a/test/e2e/run_test.sh b/test/e2e/run_test.sh index 13d9877b0..8c3b18852 100755 --- a/test/e2e/run_test.sh +++ b/test/e2e/run_test.sh @@ -44,6 +44,34 @@ EOF if [ $status -ne 0 ]; then echo "Could not setup KinD environment. Something wrong with KinD setup. Exporting logs." fi + + # Add the registry config to the nodes + # + # This is necessary because localhost resolves to loopback addresses that are network-namespace local. + # In other words: localhost in the container is not localhost on the host. + # + # We want a consistent name that works from both ends, so we tell containerd to alias localhost:${reg_port} + # to the registry container when pulling images + REGISTRY_DIR="/etc/containerd/certs.d/localhost:${KIND_REGISTRY_PORT}" + for node in $(kind get nodes --name="${NAME}"); do + docker exec "${node}" mkdir -p "${REGISTRY_DIR}" + cat << EOF | docker exec -i "${node}" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml" +[host."http://${KIND_REGISTRY_NAME}:5000"] +EOF + done + + # Document the local registry + cat <