Skip to content

Commit

Permalink
Merge pull request #71 from Luap99/iptables
Browse files Browse the repository at this point in the history
auto load ip_tables modules on boot
  • Loading branch information
openshift-merge-bot[bot] authored Jan 30, 2025
2 parents 9b8ef76 + a1f52c1 commit 8d11f97
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ verify_macos_task:
depends_on:
- image_build
persistent_worker: &mac_pw
labels:
os: darwin
arch: arm64
purpose: prod
labels:
os: darwin
arch: arm64
purpose: prod
env: &mac_env
ARCH: "aarch64"
CIRRUS_SHELL: "/bin/bash" # sh is the default
Expand Down
1 change: 1 addition & 0 deletions podman-image/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ COPY docker-host.sh /etc/profile.d/docker-host.sh
COPY 999-podman-machine.conf /etc/containers/registries.conf.d/999-podman-machine.conf
COPY 10-inotify-instances.conf /etc/sysctl.d/10-inotify-instances.conf
COPY 99-podman-sshd.conf /etc/ssh/sshd_config.d/99-podman-sshd.conf
COPY podman-iptables.conf /etc/modules-load.d/podman-iptables.conf

## Enables automatic login on the console;
## there's no security concerns here, and this makes debugging easier.
Expand Down
11 changes: 11 additions & 0 deletions podman-image/podman-iptables.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# On fedora 41 we switched netavark to nftables and no longer load ip tables
# modules: https://github.com/containers/podman/pull/24109
# While we no longer need it applications running inside a container might
# still need it, i.e. nested docker or older podman.
# Normally it would be up to the sys admin to configure this but given
# podman machine os is more of "managed" OS we should just keep it to
# avoid breaking users, https://github.com/containers/podman/issues/25153.
# TODO (6.0): consider removing this in a major release where we can justify
# removing legacy modules.
ip_tables
ip6_tables
7 changes: 7 additions & 0 deletions verify/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,18 @@ var _ = Describe("run basic podman commands", func() {
Expect(err).ToNot(HaveOccurred())
Expect(session).To(Exit(0))

// https://github.com/containers/podman-machine-os/issues/18
sshSession, err := mb.setCmd([]string{"machine", "ssh", machineName, "sudo", "systemctl", "is-active", "systemd-resolved.service"}).run()
Expect(err).ToNot(HaveOccurred())
Expect(sshSession).To(Exit(3))
Expect(sshSession.outputToString()).To(Equal("inactive"))

// https://github.com/containers/podman/issues/25153
sshSession, err = mb.setCmd([]string{"machine", "ssh", machineName, "sudo", "lsmod"}).run()
Expect(err).ToNot(HaveOccurred())
Expect(sshSession).To(Exit(0))
Expect(sshSession.outputToString()).To(And(ContainSubstring("ip_tables"), ContainSubstring("ip6_tables")))

// set by podman-rpm-info-vars.sh
if version := os.Getenv("PODMAN_VERSION"); version != "" {
// version is x.y.z while image uses x.y, remove .z so we can match
Expand Down

0 comments on commit 8d11f97

Please sign in to comment.