Skip to content

Commit 91816d9

Browse files
Merge pull request #27555 from l0rd/iptables-rm
Remove iptables references from tests, docs and WSL config
2 parents 3922526 + 343a196 commit 91816d9

File tree

9 files changed

+24
-53
lines changed

9 files changed

+24
-53
lines changed

.cirrus.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,9 @@ upgrade_test_task:
10901090
depends_on: *build
10911091
matrix:
10921092
- env:
1093-
PODMAN_UPGRADE_FROM: v4.8.0
1093+
PODMAN_UPGRADE_FROM: v5.3.1
1094+
- env:
1095+
PODMAN_UPGRADE_FROM: v5.6.2
10941096
gce_instance: *standardvm
10951097
env:
10961098
TEST_FLAVOR: upgrade_test

docs/source/locale/ja/LC_MESSAGES/markdown.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20503,9 +20503,9 @@ msgstr ""
2050320503

2050420504
#: ../../source/markdown/podman-network-reload.1.md:13
2050520505
msgid ""
20506-
"Rootful Podman relies on iptables rules in order to provide network "
20507-
"connectivity. If the iptables rules are deleted, this happens for example"
20508-
" with `firewall-cmd --reload`, the container loses network connectivity. "
20506+
"Rootful Podman relies on firewall rules in order to provide network "
20507+
"connectivity. If the firewall rules are deleted, as can happen"
20508+
" with the `firewall-cmd --reload` command, the container loses network connectivity. "
2050920509
"This command restores the network connectivity."
2051020510
msgstr ""
2051120511

docs/source/markdown/podman-network-reload.1.md.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ podman\-network\-reload - Reload network configuration for containers
99
## DESCRIPTION
1010
Reload one or more container network configurations.
1111

12-
Rootful Podman relies on iptables rules in order to provide network connectivity. If the iptables rules are deleted,
12+
Rootful Podman relies on the firewall rules in order to provide network connectivity. If the firewall rules are deleted,
1313
this happens for example with `firewall-cmd --reload`, the container loses network connectivity. This command restores
1414
the network connectivity.
1515

pkg/machine/wsl/declares.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ const containersConf = `[containers]
1212
1313
[engine]
1414
cgroup_manager = "cgroupfs"
15-
16-
# Using iptables until we fix nftables on WSL:
17-
# https://github.com/containers/podman/issues/25201
18-
[network]
19-
firewall_driver="iptables"
2015
`
2116

2217
const registriesConf = `unqualified-search-registries=["docker.io"]

rpm/podman.spec

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,6 @@ ln -s ../virtiofsd %{buildroot}%{_libexecdir}/%{name}
349349
%{_tmpfilesdir}/%{name}.conf
350350
%{_systemdgeneratordir}/%{name}-system-generator
351351
%{_systemdusergeneratordir}/%{name}-user-generator
352-
# iptables modules are only needed with iptables-legacy,
353-
# as of f41 netavark will default to nftables so do not load unessary modules
354-
# https://fedoraproject.org/wiki/Changes/NetavarkNftablesDefault
355-
%if %{defined fedora} && 0%{?fedora} < 41
356-
%{_modulesloaddir}/%{name}-iptables.conf
357-
%endif
358352

359353
%files docker
360354
%{_bindir}/docker

test/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The test currently depend on:
4141
- xz
4242
- htpasswd
4343
- iproute2
44-
- iptables
4544
- util-linux
4645
- tar
4746
- docker

test/system/500-networking.bats

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ load helpers.network
320320
run_podman 1 network rm $mynetname
321321
}
322322

323-
# CANNOT BE PARALLELIZED due to iptables/nft commands
323+
# CANNOT BE PARALLELIZED due to nft commands
324324
@test "podman network reload" {
325325
skip_if_remote "podman network reload does not have remote support"
326326

@@ -356,20 +356,17 @@ load helpers.network
356356
# rootless cannot modify the host firewall
357357
if ! is_rootless; then
358358
# for debugging only
359-
iptables -t nat -nvL || true
360359
nft list ruleset || true
361360

362361
# flush the firewall rule here to break port forwarding
363-
# netavark can use either iptables or nftables, so try flushing both
364-
iptables -t nat -F "NETAVARK-HOSTPORT-DNAT" || true
365362
nft delete table inet netavark || true
366363

367364
# check that we cannot curl (timeout after 1 sec)
368365
run curl --max-time 1 -s $SERVER/index.txt
369366
assert $status -eq 28 "curl did not time out"
370367
fi
371368

372-
# reload the network to recreate the iptables rules
369+
# reload the network to recreate the nftables rules
373370
run_podman network reload $cid
374371
is "$output" "$cid" "Output does match container ID"
375372

@@ -400,7 +397,7 @@ load helpers.network
400397
mac2="${lines[2]}"
401398

402399
# make sure --all is working and that this
403-
# cmd also works if the iptables still exists
400+
# cmd also works if the nftables still exists
404401
run_podman network reload --all
405402
is "$output" "$cid" "Output does match container ID"
406403

test/upgrade/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,19 @@ container image from quay.io/podman, uses it to create and run
2121
a number of containers, then uses new-podman to interact with
2222
those containers.
2323

24-
As of 2024-02-05 the available old-podman versions are:
24+
Testing updates from versions earlier than v5.3.1 fails. Testing updates from
25+
tags that do not respect semantic versioning fails too (e.g. v5.6.0-immutable or
26+
v5.6). As of 2025-11-18 the available old-podman versions to test against are:
2527

2628
```console
27-
$ bin/podman search --list-tags --limit=400 quay.io/podman/stable | awk '$2 ~ /^v/ { print $2}' | sort | column -c 75
28-
v1.4.2 v1.9.1 v3.2.0 v3.4.0 v4.1.0 v4.3.1 v4.5.1 v4.8
29-
v1.4.4 v2.0.2 v3.2.1 v3.4.1 v4.1.1 v4.4 v4.6 v4.8.0
30-
v1.5.0 v2.0.6 v3.2.2 v3.4.2 v4.2 v4.4.1 v4.6.1 v4.8.1
31-
v1.5.1 v2.1.1 v3.2.3 v3.4.4 v4.2.0 v4.4.2 v4.6.2 v4.8.2
32-
v1.6 v2.2.1 v3.3.0 v3.4.7 v4.2.1 v4.4.4 v4.7 v4.8.3
33-
v1.6.2 v3 v3.3.1 v4 v4.3 v4.5 v4.7.0 v4.9
34-
v1.9.0 v3.1.2 v3.4 v4.1 v4.3.0 v4.5.0 v4.7.2 v4.9.0
29+
$ bin/podman search --list-tags --limit=400 quay.io/podman/stable | awk '$2 ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print $2}' | sort | awk '/v5.3.1/,0' | column -c 75
30+
v5.3.1 v5.4.0 v5.4.2 v5.5.1 v5.6.0 v5.6.2
31+
v5.3.2 v5.4.1 v5.5.0 v5.5.2 v5.6.1
3532
```
3633

3734
Test invocation is:
3835
```console
39-
$ sudo env PODMAN=bin/podman PODMAN_UPGRADE_FROM=v4.1.0 PODMAN_UPGRADE_TEST_DEBUG= bats test/upgrade
36+
$ sudo env PODMAN=bin/podman PODMAN_UPGRADE_FROM=v5.3.1 PODMAN_UPGRADE_TEST_DEBUG= bats test/upgrade
4037
```
4138
(Path assumes you're cd'ed to top-level podman repo). `PODMAN_UPGRADE_FROM`
4239
can be any of the versions above. `PODMAN_UPGRADE_TEST_DEBUG` is empty

test/upgrade/test-upgrade.bats

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ setup() {
4949
# the default c/storage behavior is to make the mount propagation private.
5050
export _PODMAN_TEST_OPTS="--storage-opt=skip_mount_home=true --cgroup-manager=cgroupfs --root=$PODMAN_UPGRADE_WORKDIR/root --runroot=$PODMAN_UPGRADE_WORKDIR/runroot --tmpdir=$PODMAN_UPGRADE_WORKDIR/tmp"
5151

52-
# Old netavark used iptables but newer versions might uses nftables.
53-
# Networking can only work correctly if both use the same firewall driver so force iptables.
54-
printf "[network]\nfirewall_driver=\"iptables\"\n" > $PODMAN_UPGRADE_WORKDIR/containers.conf
52+
53+
# Starting with v6.0.0 we only test upgrade from versions that support nftables.
54+
printf "[network]\nfirewall_driver=\"nftables\"\n" > $PODMAN_UPGRADE_WORKDIR/containers.conf
5555
export CONTAINERS_CONF_OVERRIDE=$PODMAN_UPGRADE_WORKDIR/containers.conf
5656
}
5757

@@ -64,21 +64,6 @@ setup() {
6464
OLD_PODMAN=quay.io/podman/stable:$PODMAN_UPGRADE_FROM
6565
$PODMAN pull $OLD_PODMAN
6666

67-
# Can't mix-and-match iptables.
68-
# This can only fail when we bring in new CI VMs. If/when it does fail,
69-
# we'll need to figure out how to solve it. Until then, punt.
70-
iptables_old_version=$($PODMAN run --rm $OLD_PODMAN iptables -V)
71-
run -0 expr "$iptables_old_version" : ".*(\(.*\))"
72-
iptables_old_which="$output"
73-
74-
iptables_new_version=$(iptables -V)
75-
run -0 expr "$iptables_new_version" : ".*(\(.*\))"
76-
iptables_new_which="$output"
77-
78-
if [[ "$iptables_new_which" != "$iptables_old_which" ]]; then
79-
die "Cannot mix iptables; $PODMAN_UPGRADE_FROM container uses $iptables_old_which, host uses $iptables_new_which"
80-
fi
81-
8267
# Shortcut name, because we're referencing it a lot
8368
pmroot=$PODMAN_UPGRADE_WORKDIR
8469

@@ -223,8 +208,10 @@ EOF
223208

224209
@test "images" {
225210
run_podman images -a --format '{{.Names}}'
226-
assert "${lines[0]}" =~ "\[localhost/podman-pause:${PODMAN_UPGRADE_FROM##v}-.*\]" "podman images, line 0"
227-
assert "${lines[1]}" = "[$IMAGE]" "podman images, line 1"
211+
# Filter out the podman-pause image which isn't present for
212+
# versions >= 5.5.0
213+
run -0 grep -v "localhost/podman-pause" <<< "$output"
214+
assert "${lines[0]}" = "[$IMAGE]" "podman images, line 0"
228215
}
229216

230217
@test "ps : one container running" {

0 commit comments

Comments
 (0)