Add isolated kind dependency testbed

This commit is contained in:
ms2k 2026-07-17 18:30:34 +09:00
commit 5759938f3f

39
tests/kind/provider/nerdctl Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ "${1:-}" = run ]]; then
shift
arguments=()
for argument in "$@"; do
if [[ "$argument" = kind ]]; then
arguments+=(nuthatch-kind)
else
arguments+=("$argument")
fi
done
exec "$NUTHATCH_REAL_NERDCTL" run --memory 20g --memory-swap 28g --cpus 8 "${arguments[@]}"
fi
# kind otherwise gives every rootless namespace the same bridge and IPv6 subnet.
if [[ "${1:-}" = network ]]; then
arguments=()
for argument in "$@"; do
case "$argument" in
kind)
arguments+=(nuthatch-kind)
;;
fc00:f853:ccd:e793::/64)
arguments+=(fc00:f853:ccd:e794::/64)
;;
--subnet=fc00:f853:ccd:e793::/64)
arguments+=(--subnet=fc00:f853:ccd:e794::/64)
;;
*)
arguments+=("$argument")
;;
esac
done
exec "$NUTHATCH_REAL_NERDCTL" "${arguments[@]}"
fi
exec "$NUTHATCH_REAL_NERDCTL" "$@"