podman/pkg/specgen
Matt Heon a619c03eff Include exposed ports in inspect output when net=host
Previously, we didn't bother including exposed ports in the
container config when creating a container with --net=host. Per
Docker this isn't really correct; host-net containers are still
considered to have exposed ports, even though that specific
container can be guaranteed to never use them.

We could just fix this for host container, but we might as well
make it generic. This patch unconditionally adds exposed ports to
the container config - it was previously conditional on a network
namespace being configured. The behavior of `podman inspect` with
exposed ports when using `--net=container:` has also been
corrected. Previously, we used exposed ports from the container
sharing its network namespace, which was not correct. Now, we use
regular port bindings from the namespace container, but exposed
ports from our own container.

Fixes https://issues.redhat.com/browse/RHEL-60382

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-09-27 12:54:24 -04:00
..
generate Include exposed ports in inspect output when net=host 2024-09-27 12:54:24 -04:00
container_validate.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
namespaces.go Merge pull request #23857 from rhatdan/run 2024-09-17 20:31:28 +00:00
namespaces_test.go bump go to 1.22 2024-09-03 15:14:15 +02:00
pod_validate.go Remove containers/common/pkg/config from pkg/util 2024-09-06 07:45:04 -04:00
podspecgen.go Add --restart flag to pod create 2023-05-02 10:29:58 -04:00
resources_freebsd.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
resources_linux.go specgen/generate: Factor out setting resource limits from CompleteSpec 2022-09-08 08:24:18 +01:00
specgen.go Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
specgen_local.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_remote.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
specgen_test.go Convert SpecGen values to be nullable where possible 2024-01-30 10:42:24 -05:00
utils.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
utils_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
volumes.go Add support for image volume subpaths 2024-04-25 14:12:27 -04:00
winpath.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
winpath_linux.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
winpath_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
winpath_windows.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00