Expand description
Removed-container bookkeeping for --status (issue #225).
A kept docker container can be removed later (by hand, by an orchestrator,
or by start-command’s own cleanup policy). docker inspect then exits 1
with No such object / No such container, which used to be folded into
the same None as “docker could not be queried at all”, so --status kept
reporting the old containerId as if the container still held its disk.
This module tells the two failures apart and records the removal on the
execution record as containerState: removed plus
containerRemovedObservedAt. containerId is kept for history.
Constants§
- CONTAINER_
REMOVED_ ENV - Environment variable the detached watcher sets for the finalizer when its
own
docker rm -fremoved the container. - CONTAINER_
STATE_ REMOVED containerStateof a record whose container no longer exists.
Functions§
- attach_
container_ removal - Attach
containerState: removedto a finished detached docker record whose container no longer exists. The container id is preferred over the session name, so a later container that reuses the name is not mistaken for it. - is_
docker_ not_ found - Whether a failed
docker inspectanswered that the object is unknown:Error: No such object: <name>(docker inspect, Docker 29 prints it lower-case) orError response from daemon: No such container: <name>. A daemon that cannot be reached (“Cannot connect”, “failed to connect … no such file or directory”) does not match. - mark_
container_ removed - Set
containerState: removedon a record, keeping an earlier observation time when there is one. - persist_
container_ removal - Persist a removal
--statusobserved, best effort: a read-only query must never fail because the store could not be written.