podman/pkg/specgen/generate
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
..
kube Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
config_common.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
config_common_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
config_freebsd.go Bump tags.cncf.io/container-device-interface to v0.7.1 2024-04-06 12:25:26 +02:00
config_linux.go update golangci-lint to 1.60.1 2024-08-19 11:41:28 +02:00
config_linux_seccomp.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
config_linux_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
container.go Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
container_create.go Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
namespaces.go Include exposed ports in inspect output when net=host 2024-09-27 12:54:24 -04:00
namespaces_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
namespaces_linux.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
oci.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
oci_freebsd.go Add volumes-from support using annotation in kube yaml 2024-02-14 07:31:43 -08:00
oci_linux.go Fix `podman stop` and `podman run --rmi` 2024-08-20 09:51:18 -04:00
pause_image.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
pod_create.go Add --health-max-log-count, --health-max-log-size, --health-log-destination flags 2024-09-25 14:01:35 +02:00
pod_create_test.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
ports.go allow exposed sctp ports 2024-09-18 14:24:45 +02:00
ports_bench_test.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
ports_test.go bump go to 1.22 2024-09-03 15:14:15 +02:00
security_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
security_linux.go Replace golang.org/x/exp/slices with slices from std 2024-04-23 11:16:40 +02:00
storage.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
storage_freebsd.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
storage_linux.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
validate_freebsd.go Bump Go module to v5 2024-02-08 09:35:39 -05:00
validate_linux.go pkg/specgen: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00