podman/libpod/define
Valentin Rothberg 08b0d93ea3 kube play: exit-code propagation
Implement means for reflecting failed containers (i.e., those having
exited non-zero) to better integrate `kube play` with systemd.  The
idea is to have the main PID of `kube play` exit non-zero in a
configurable way such that systemd's restart policies can kick in.

When using the default sdnotify-notify policy, the service container
acts as the main PID to further reduce the resource footprint.  In that
case, before stopping the service container, Podman will lookup the exit
codes of all non-infra containers.  The service will then behave
according to the following three exit-code policies:

 - `none`: exit 0 and ignore containers (default)
 - `any`: exit non-zero if _any_ container did
 - `all`: exit non-zero if _all_ containers did

The upper values can be passed via a hidden `kube play
--service-exit-code-propagation` flag which can be used by tests and
later on by Quadlet.

In case Podman acts as the main PID (i.e., when at least one container
runs with an sdnotify-policy other than "ignore"), Podman will continue
to wait for the service container to exit and reflect its exit code.

Note that this commit also fixes a long-standing annoyance of the
service container exiting non-zero.  The underlying issue was that the
service container had been stopped with SIGKILL instead of SIGTERM and
hence exited non-zero.  Fixing that was a prerequisite for the exit-code
propagation to work but also improves the integration of `kube play`
with systemd and hence Quadlet with systemd.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:34 +02:00
..
annotations.go Support running nested SELinux container separation 2023-03-13 14:21:12 -04:00
autoupdate.go auto-update: validate container image 2022-09-26 17:07:05 +02:00
checkpoint_restore.go Added optional container checkpointing statistics 2021-11-15 11:50:24 +00:00
config.go Compile regex on demand not in init 2023-01-11 14:38:51 -05:00
container.go Support Deployment generation with kube generate 2023-03-31 13:34:38 -04:00
container_inspect.go kube play: exit-code propagation 2023-05-25 14:46:34 +02:00
containerstate.go bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
diff.go podman diff accept two images or containers 2021-07-02 17:11:56 +02:00
errors.go Fix #15499 already connected network 2022-08-27 20:03:40 -05:00
exec_codes.go Run codespell 2022-08-25 16:32:31 -04:00
exit_code_propagation.go kube play: exit-code propagation 2023-05-25 14:46:34 +02:00
fileinfo.go Fixes from make codespell 2021-04-21 13:16:33 -04:00
healthchecks.go Add support for startup healthchecks 2022-11-28 13:30:29 -05:00
info.go podman: Add pasta to podman info 2023-05-25 00:39:52 +08:00
mount.go libpod/define: Make TypeBind a platform-specific constant 2022-08-30 16:32:24 +01:00
mount_freebsd.go libpod/define: Make TypeBind a platform-specific constant 2022-08-30 16:32:24 +01:00
mount_linux.go libpod/define: Make TypeBind a platform-specific constant 2022-08-30 16:32:24 +01:00
mount_unsupported.go libpod/define: Make TypeBind a platform-specific constant 2022-08-30 16:32:24 +01:00
pod_inspect.go Add --restart flag to pod create 2023-05-02 10:29:58 -04:00
podstate.go Add a Degraded state to pods 2020-10-21 13:31:40 -04:00
runtime.go Add support for containers.conf 2020-03-27 14:36:03 -04:00
sdnotify.go kube play: sd-notify integration 2022-08-10 21:12:39 +02:00
version.go Add 'Os' to be queried via 'version' output 2022-03-29 18:10:59 -04:00
volume_inspect.go Add support for 'image' volume driver 2022-09-22 13:07:40 -04:00