info
info
¶
Podman version and capability detection.
Parses podman info -f json into a structured
PodmanInfo dataclass, with
just enough metadata for shield to choose a network mode.
This module is stateless — callers cache the result.
PodmanInfo(version, rootless_network_cmd, pasta_executable, slirp4netns_executable)
dataclass
¶
Parsed podman environment information.
Constructed from podman info -f json output. Stateless — the
caller manages caching.
version
instance-attribute
¶
rootless_network_cmd
instance-attribute
¶
pasta_executable
instance-attribute
¶
slirp4netns_executable
instance-attribute
¶
network_mode
property
¶
Determine the rootless network mode.
Uses rootlessNetworkCmd when available (podman 5+).
When absent (podman 4.x), defaults to slirp4netns if its
executable is available — podman 4.x defaults to slirp4netns.
parse_podman_info(json_str)
¶
Parse podman info -f json output into a PodmanInfo.
Returns a zero-version fallback on invalid or partially-malformed input —
every nested section is coerced through an isinstance(..., dict)
guard so a scalar/list where a table is expected can never produce
an AttributeError.