spiegel_podman/pkg
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 Remove ReservedAnnotations from kube generate specification 2023-01-18 08:46:24 -05:00
api Merge pull request #18595 from containers/renovate/github.com-docker-docker-24.x 2023-05-22 11:54:12 -04:00
auth fix(deps): update module github.com/docker/docker to v24 2023-05-22 15:32:12 +02:00
autoupdate auto-update: return errors when checking for updates 2023-04-25 12:15:22 +02:00
bindings source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
channel bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
checkpoint Update checkpointctl v0.1.0 2023-03-07 18:28:39 +00:00
copy pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
criu deps: bump go-criu to v6 2022-11-01 13:57:24 +05:30
ctime Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
domain kube play: exit-code propagation 2023-05-25 14:46:34 +02:00
env vendor: bump containers/(storage, common, buildah, image) 2023-04-10 17:30:14 +05:30
errorhandling Fix typos 2023-02-11 18:23:24 +01:00
inspect pkg/inspect: remove unused ImageResult type 2022-05-24 16:07:39 +02:00
k8s.io *: migrate image registry to registry.k8s.io 2023-04-11 10:30:43 -04:00
lookup source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
machine Merge pull request #18639 from rhatdan/pull 2023-05-22 11:59:30 -04:00
namespaces source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00
parallel Fix stutters 2022-09-10 07:52:00 -04:00
ps Add {{.Restarts}} to podman ps 2023-05-02 10:30:07 -04:00
rctl pkg/rctl: Remove unused cgo dependency 2022-10-31 15:13:48 +00:00
rootless Add file swith for pre-exec 2023-04-26 10:20:10 -04:00
rootlessport go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
seccomp pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
servicereaper go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
signal Run codespell on code 2022-11-04 10:57:41 -04:00
specgen Merge pull request #18595 from containers/renovate/github.com-docker-docker-24.x 2023-05-22 11:54:12 -04:00
specgenutil run: ignore PODMAN_USERNS with --pod 2023-05-17 16:49:16 +02:00
systemd Quadlet - add support for PodmanArgs to all groups 2023-05-24 10:05:02 +03:00
terminal podman ssh work, using new c/common interface 2022-08-09 14:00:58 -04:00
timetype bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
trust chore: replace github.com/ghodss/yaml with sigs.k8s.io/yaml 2023-04-06 21:11:17 +08:00
util source code comments and docs: fix typos, language, Markdown layout 2023-05-22 07:52:16 +02:00