Skip to content

Comments

Fix podman test compatibility: remove hardcoded network backend#14422

Open
Copilot wants to merge 4 commits intomasterfrom
copilot/debug-podman-slirp4netns
Open

Fix podman test compatibility: remove hardcoded network backend#14422
Copilot wants to merge 4 commits intomasterfrom
copilot/debug-podman-slirp4netns

Conversation

Copy link

Copilot AI commented Feb 18, 2026

Description:

Podman container tests failed on openSUSE with two sequential errors:

  1. Error: unknown option for slirp4netns: "mtu=1500" - older slirp4netns versions reject this parameter
  2. RuntimeError: Unable to extract SSH ports from the container - hardcoded network backend incompatible with newer podman installations

Changes to tests/ssg_test_suite/test_env.py:

  • Removed --network slirp4netns from container creation (line 536)
  • Added validation for empty/null port data in extract_port_map() (lines 575-584)
  • Preserved exception context via raise ... from exc for debugging (line 370)

Rationale:

Modern podman (4.x+) defaults to netavark; older installations use slirp4netns. Hardcoding either breaks compatibility. The MTU parameter was redundant (default=1500) and unsupported on older slirp4netns versions.

Letting podman auto-select its network backend ensures compatibility across:

  • Podman versions (3.x with slirp4netns, 4.x+ with netavark)
  • Linux distributions (openSUSE, RHEL, Ubuntu, Fedora)
  • Deployment modes (rootless, rootful)

Review Hints:

Single file changed. Key modification in PodmanTestEnv._new_container_from_image() removes two network-related parameters from the podman run command. Error handling improvements preserve exception chains for debugging.

The commit marked "(grafted)" in git log shows all repository files due to shallow clone artifact - actual changes limited to test_env.py.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Used by openshift-ci bot. needs-ok-to-test Used by openshift-ci bot. labels Feb 18, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

Hi @Copilot. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Co-authored-by: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug Podman with slirp4netns Remove unsupported mtu parameter from podman slirp4netns configuration Feb 18, 2026
@Mab879
Copy link
Member

Mab879 commented Feb 18, 2026

Before we just go and revert this we should better understand the problem space.

@alanmcanonical thoughts?

Copilot AI and others added 2 commits February 18, 2026 18:00
- Remove --network slirp4netns to use podman's default network backend
- Add better error handling in extract_port_map for edge cases
- Preserve original exception for better debugging in get_ssh_port
- Fixes compatibility across different podman/slirp4netns versions

Co-authored-by: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com>
- Remove redundant logging statement (exception is preserved via raise...from)
- Simplify validation logic by removing redundant length check
- Keep exception chaining for better debugging

Co-authored-by: teacup-on-rockingchair <315160+teacup-on-rockingchair@users.noreply.github.com>
Copilot AI changed the title Remove unsupported mtu parameter from podman slirp4netns configuration Fix podman container tests on openSUSE and systems with varying network backends Feb 18, 2026
@Mab879
Copy link
Member

Mab879 commented Feb 18, 2026

@copilot Why there an empty commit (d6bf415) on this PR?

Copilot AI changed the title Fix podman container tests on openSUSE and systems with varying network backends Fix podman test compatibility: remove hardcoded network backend Feb 19, 2026
@comps
Copy link
Collaborator

comps commented Feb 19, 2026

@Mab879 One thing valid here (and I wanted to file an issue about it, but didn't have time) is that podman 6.0 removes slirp4netns, so us selecting it explicitly is probably going to break something soon (in Fedora 44 and other bleeding-edge distros).

@alanmcanonical
Copy link
Contributor

Before we just go and revert this we should better understand the problem space.

@alanmcanonical thoughts?

Looked up the podman man, slirp4netns-mtu became available from https://docs.podman.io/en/v3.0/markdown/podman-run.1.html. I am considering available runtime fixes that can work across distros and podmans.

@alanmcanonical
Copy link
Contributor

After investigation, it was apparmor pasta profile which rejects the packet https://bugs.launchpad.net/snapd/+bug/2141298 in my local env. So the mtu option can be safely removed if the opensuse issue occurred from running container on ubuntu image

Copy link
Contributor

@teacup-on-rockingchair teacup-on-rockingchair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me and does the job of running the podman container on openSUSE host

@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 20, 2026
@teacup-on-rockingchair teacup-on-rockingchair added this to the 0.1.81 milestone Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants