1
0
forked from wrenn/wrenn

Fix expandEnv regex, init script crash, healthcheck deadline, and test issues

- Fix envRegex: remove spurious (\$)? group that swallowed $$$, handle ${}
- wrenn-init.sh: add || true to networking commands under set -e, remove dead code
- waitForHealthcheck: use context deadline for unlimited retries instead of implicit 100 cap
- Make parseSandboxEnv a package-level function (unused receiver)
- Fix WrappedCommand test: map iteration order dependency, pre-expand env values
- Fix error wrapping: %v → %w per project conventions
- test-jupyter-kernel.py: move import to top-level, fix misleading comment
This commit is contained in:
2026-04-08 02:14:38 +06:00
parent 11e08e5b96
commit 0ea0e7cc70
5 changed files with 51 additions and 53 deletions

View File

@ -20,34 +20,14 @@ echo "+cpu +memory +io" > /sys/fs/cgroup/cgroup.subtree_control 2>/dev/null || t
# Set hostname
hostname sandbox
# Configure networking from kernel cmdline (ip=client::gw:mask:host:iface:autoconf).
# if command -v ip >/dev/null 2>&1; then
# iparg=$(cat /proc/cmdline | tr ' ' '\n' | sed -n 's/^ip=//p')
# if [ -n "$iparg" ]; then
# client=$(echo "$iparg" | cut -d: -f1)
# gw=$(echo "$iparg" | cut -d: -f2)
# mask=$(echo "$iparg" | cut -d: -f3)
# iface=$(echo "$iparg" | cut -d: -f5)
# [ -z "$iface" ] && iface=eth0
# if [ -n "$client" ]; then
# ip addr add "$client/${mask:-30}" dev "$iface" 2>/dev/null || true
# ip link set "$iface" up 2>/dev/null || true
# if [ -n "$gw" ]; then
# ip route add default via "$gw" 2>/dev/null || true
# fi
# fi
# fi
# fi
#
#
# Configure networking if the kernel ip= boot arg did not already set it up.
if ! ip addr show eth0 2>/dev/null | grep -q "169.254.0.21"; then
ip link set lo up
ip link set eth0 up
ip addr add 169.254.0.21/30 dev eth0
ip route add default via 169.254.0.22
ip link set lo up 2>/dev/null || true
ip link set eth0 up 2>/dev/null || true
ip addr add 169.254.0.21/30 dev eth0 2>/dev/null || true
ip route add default via 169.254.0.22 2>/dev/null || true
fi
# Configure DNS resolver.
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf