Skip unresolvable domains in firewall allowlist instead of aborting

If DNS resolution transiently fails for one domain, the whole postStart
hook used to exit 1 and leave the container without a firewall. Warn and
continue so the remaining rules still get installed.
This commit is contained in:
Samuel Bouchet 2026-04-17 21:13:06 +02:00
parent 3077b2d669
commit eba81400a8

View file

@ -74,8 +74,8 @@ for domain in \
echo "Resolving $domain..."
ips=$(dig +noall +answer A "$domain" | awk '$4 == "A" {print $5}')
if [ -z "$ips" ]; then
echo "ERROR: Failed to resolve $domain"
exit 1
echo "WARN: Failed to resolve $domain - skipping"
continue
fi
while read -r ip; do