39 lines
931 B
Text
39 lines
931 B
Text
|
|
#!/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" "$@"
|