Why use pod id or container id if host+pid is sufficient?

11/28/2018

Given that it is sufficient to use a host+pid to uniquely identify a process even in the face of containers

Why do many container commands (see for example kubernetes restart container within pod) use pod and container ids instead?

-- Bruce Adams
docker
kubernetes

1 Answer

11/28/2018

Possible answer (currently the best and only one):

As alluded to in the quoted question a PID is potentially ambiguous. It could be from the PID of the container's namespace or the host. The container may not be able to identify the host and PID itself (after all it is supposed to be a sandbox).

-- Bruce Adams
Source: StackOverflow