moby/libcontainerd
Cory Snider 975bdb2c96 daemon: identify container exits by ProcessID
The Pid field of an exit event cannot be relied upon to differentiate
exits of the container's task from exits of other container processes,
i.e. execs. The Pid is reported by the runtime and is implementation-
defined so there is no guarantee that a task's pid is distinct from the
pids of any other process in the same container. In particular,
kata-containers reports the pid of the hypervisor for all exit events.
Update the daemon to differentiate container exits from exec exits by
inspecting the event's ProcessID.

The local_windows libcontainerd implementation already sets the
ProcessID to InitProcessName on container exit events. Update the remote
libcontainerd implementation to match. ContainerD guarantees that the
process ID of a task (container init process) is set to the
corresponding container ID, so use that invariant to distinguish task
exits from other process exits.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-01-31 12:14:50 -05:00
..
local gofmt GoDoc comments with go1.19 2022-07-13 22:42:29 +02:00
queue bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
remote daemon: identify container exits by ProcessID 2023-01-31 12:14:50 -05:00
supervisor libcontainerd: switch generated containerd.toml to v2 (v1 is deprecated) 2022-07-28 16:45:26 +02:00
types libcontainerd: SignalProcess(): accept syscall.Signal 2022-05-05 00:53:49 +02:00
libcontainerd_linux.go Configure shims from runtime config 2020-07-13 14:18:02 -07:00
libcontainerd_windows.go Remove unused useShimV2() 2020-07-15 14:28:48 +02:00