container_info
container_info
¶
Container-inspection facts the clearance client cares about.
A minimal view over what podman inspect returns — enough for the
notifier / TUI subscriber to label an event. Lives in the domain
layer because it's pure data; the thing that produces a
ContainerInfo lives at client/podman_inspector.py.
Annotation semantics are caller-owned. This module doesn't know
about ai.terok.* keys; whoever pulls a ContainerInfo
plucks the annotations it understands.
ContainerInfo(container_id='', name='', state='', annotations=(lambda: _EMPTY_ANNOTATIONS)())
dataclass
¶
What podman inspect tells us about one container.
Empty instance (ContainerInfo()) represents "not found" or
"lookup failed" — callers should treat missing fields as
best-effort and fall back to the raw container ID when they
don't have a better label.
container_id = ''
class-attribute
instance-attribute
¶
The short ID podman reported back, or empty on failure.
name = ''
class-attribute
instance-attribute
¶
The container's name without podman's leading / prefix.
state = ''
class-attribute
instance-attribute
¶
Lifecycle state: running, exited, created, etc. Empty when unknown.
annotations = field(default_factory=(lambda: _EMPTY_ANNOTATIONS))
class-attribute
instance-attribute
¶
Every OCI annotation podman recorded for this container.
Exposed as a read-only Mapping — cached instances are
shared across inspector callers, so mutating the underlying dict
would poison future lookups. Build with types.MappingProxyType
at construction time; callers (clearance's task-aware resolver,
anything else that cares) pluck out the keys they know about.