contrib/rootless-setuptool: Fix iptables detection

Fix a logical error in the rootless setup tool where the iptables error
handling was incorrectly placed. The code was setting
`faced_iptables_error=1` even when iptables was available, causing
unnecessary error messages and setup suggestions.

This patch correctly moves the error handling into the `else` branch so
that we only report iptables errors when the command is actually
unavailable.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-04-17 19:23:15 +02:00
parent 6573a13e4a
commit ead379a464

View File

@@ -152,6 +152,7 @@ init() {
case $iptables_version in
*legacy*) iptables_module="ip_tables" ;;
esac
else
faced_iptables_error=1
if [ -z "$OPT_SKIP_IPTABLES" ]; then
if command -v apt-get > /dev/null 2>&1; then