Exposed ports are only included when not --net=host#24164
Exposed ports are only included when not --net=host#24164openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
Conversation
|
Ephemeral COPR build failed. @containers/packit-build please check. |
|
code lgtm |
libpod/container_inspect.go
Outdated
There was a problem hiding this comment.
typo
but personally I would have a slight preference for if c.config.NetNsCtr == "" && c.NetworkMode() != "host" as I think this is clearer but it should be logically the same
bb2c24c to
5fed0ae
Compare
|
Cockpit tests failed for commit bb2c24c212a53fabd841c8e06838a22842f6b329. @martinpitt, @jelly, @mvollmer please check. |
Undoing some of my own work here from containers#24090 now that we have the ExposedPorts field implemented in inspect. I considered a revert of that patch, but it's still needed as without it we'd be including exposed ports when --net=container which is not correct. Basically, exposed ports for a container should always go in the new ExposedPorts field we added. They sometimes go in the Ports field in NetworkSettings, but only when the container is not net=host and not net=container. We were always including exposed ports, which was not correct, but is an easy logical fix. Also required is a test change to correct the expected behavior as we were testing for incorrect behavior. Fixes https://issues.redhat.com/browse/RHEL-60382 Signed-off-by: Matt Heon <mheon@redhat.com>
5fed0ae to
8061553
Compare
|
Tests green |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, mheon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This fixes an exposed ports issue in RHEL 4.9-rhel for RHEL 9.5. This includes the fixes from the following PRs: First PR: containers#24090 Second PR: containers#24110 Third PR: containers#24164 With an additional tweak from @Luap99 in containers#24333 regarding the looping in libpod/container_inspect.go. This changes is needed in the 5.2-rhel branch to assure successful upgrades as the same patches have been used for the following issues in the Podman v4.9-rhel branch Fixes: https://issues.redhat.com/browse/ACCELFIX-299 Fixes: https://issues.redhat.com/browse/ACCELFIX-300 Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
Undoing some of my own work here from #24090 now that we have the ExposedPorts field implemented in inspect. I considered a revert of that patch, but it's still needed as without it we'd be including exposed ports when --net=container which is not correct.
Basically, exposed ports for a container should always go in the new ExposedPorts field we added. They sometimes go in the Ports field in NetworkSettings, but only when the container is not net=host and not net=container. We were always including exposed ports, which was not correct, but is an easy logical fix.
Also required is a test change to correct the expected behavior as we were testing for incorrect behavior.
Fixes https://issues.redhat.com/browse/RHEL-60382
Does this PR introduce a user-facing change?