Fix podman test compatibility: remove hardcoded network backend#14422
Fix podman test compatibility: remove hardcoded network backend#14422
Conversation
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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>
|
Before we just go and revert this we should better understand the problem space. @alanmcanonical thoughts? |
- 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 Why there an empty commit (d6bf415) on this PR? |
|
@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 |
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. |
|
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 |
teacup-on-rockingchair
left a comment
There was a problem hiding this comment.
Looks ok to me and does the job of running the podman container on openSUSE host
Description:
Podman container tests failed on openSUSE with two sequential errors:
Error: unknown option for slirp4netns: "mtu=1500"- older slirp4netns versions reject this parameterRuntimeError: Unable to extract SSH ports from the container- hardcoded network backend incompatible with newer podman installationsChanges to
tests/ssg_test_suite/test_env.py:--network slirp4netnsfrom container creation (line 536)extract_port_map()(lines 575-584)raise ... from excfor 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:
Review Hints:
Single file changed. Key modification in
PodmanTestEnv._new_container_from_image()removes two network-related parameters from thepodman runcommand. 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.