spiegel_podman/pkg/specgen/generate
Matthew Heon 484bd0af1d Ensure pod infra containers have an exit command
Most Libpod containers are made via `pkg/specgen/generate` which
includes code to generate an appropriate exit command which will
handle unmounting the container's storage, cleaning up the
container's network, etc. There is one notable exception: pod
infra containers, which are made entirely within Libpod and do
not touch pkg/specgen. As such, no cleanup process, network never
cleaned up, bad things can happen.

There is good news, though - it's not that difficult to add this,
and it's done in this PR. Generally speaking, we don't allow
passing options directly to the infra container at create time,
but we do (optionally) proxy a pre-approved set of options into
it when we create it. Add ExitCommand to these options, and set
it at time of pod creation using the same code we use to generate
exit commands for normal containers.

Fixes #7103

Signed-off-by: Matthew Heon <mheon@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-24 11:31:37 -04:00
..
config_linux.go Mask out /sys/dev to prevent information leak from the host 2020-07-22 14:35:30 -04:00
config_linux_cgo.go move go module to v2 2020-07-06 15:52:17 +02:00
config_linux_nocgo.go move go module to v2 2020-07-06 15:52:17 +02:00
container.go Ensure DefaultEnvVariables is used in Specgen 2020-08-20 12:16:53 -04:00
container_create.go Fix handling of working dir 2020-08-20 12:16:53 -04:00
namespaces.go Add username to /etc/passwd inside of container if --userns keep-id 2020-08-11 14:58:29 +02:00
oci.go Ensure DefaultEnvVariables is used in Specgen 2020-08-20 12:16:53 -04:00
pod_create.go Ensure pod infra containers have an exit command 2020-08-24 11:31:37 -04:00
ports.go Binding the same container port to >1 host port is OK 2020-07-31 11:41:05 -04:00
security.go In podman 1.* regression on --cap-add 2020-08-21 10:55:22 -04:00
storage.go move go module to v2 2020-07-06 15:52:17 +02:00
validate.go move go module to v2 2020-07-06 15:52:17 +02:00