Not sure whether I'm holding it wrong, but Podman::info
returns an HostInfo
with all fields set to None
.
HostInfo { arch: None, buildah_version: None, cgroup_controllers: None, cgroup_manager: None, cgroup_version: None, conmon: None, cpus: None, distribution: None, event_logger: None, hostname: None, id_mappings: None, kernel: None, linkmode: None, log_driver: None, mem_free: None, mem_total: None, oci_runtime: None, os: None, remote_socket: None, runtime_info: None, security: None, service_is_remote: None, slirp4netns: None, swap_free: None, swap_total: None, uptime: None }
I investigated a bit and indeed the query returns the following raw string
"{\"host\":{\"arch\":\"amd64\",\"buildahVersion\":\"1.23.1\",\"cgroupManager\":\"systemd\",\"cgroupVersion\":\"v2\",\"cgroupControllers\":[\"cpu\",\"io\",\"memory\",\"pids\"],\"conmon\":{\"package\":\"conmon-2.1.0-2.fc35.x86_64\",\"path\":\"/usr/bin/conmon\",\"version\":\"conmon version 2.1.0, commit: \"},\"cpus\":16,\"distribution\":{\"distribution\":\"fedora\",\"variant\":\"silverblue\",\"version\":\"35\"},\"eventLogger\":\"journald\",\"hostname\":\"asus-tuf-gaming-X570-plus\",\"idMappings\":{\"gidmap\":[{\"container_id\":0,\"host_id\":1000,\"size\":1},{\"container_id\":1,\"host_id\":100000,\"size\":65536}],\"uidmap\":[{\"container_id\":0,\"host_id\":1000,\"size\":1},{\"container_id\":1,\"host_id\":100000,\"size\":65536}]},\"kernel\":\"5.16.12-200.fc35.x86_64\",\"logDriver\":\"journald\",\"memFree\":1817989120,\"memTotal\":33623433216,\"ociRuntime\":{\"name\":\"crun\",\"package\":\"crun-1.4.2-1.fc35.x86_64\",\"path\":\"/usr/bin/crun\",\"version\":\"crun version 1.4.2\\ncommit: f6fbc8f840df1a414f31a60953ae514fa497c748\\nspec: 1.0.0\\n+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL\"},\"os\":\"linux\",\"remoteSocket\":{\"path\":\"/run/user/1000/podman/podman.sock\",\"exists\":true},\"serviceIsRemote\":false,\"security\":{\"apparmorEnabled\":false,\"capabilities\":\"CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT\",\"rootless\":true,\"seccompEnabled\":true,\"seccompProfilePath\":\"/usr/share/containers/seccomp.json\",\"selinuxEnabled\":true},\"slirp4netns\":{\"executable\":\"/usr/bin/slirp4netns\",\"package\":\"slirp4netns-1.1.12-2.fc35.x86_64\",\"version\":\"slirp4netns version 1.1.12\\ncommit: 7a104a101aa3278a2152351a082a6df71f57c9a3\\nlibslirp: 4.6.1\\nSLIRP_CONFIG_VERSION_MAX: 3\\nlibseccomp: 2.5.3\"},\"swapFree\":6812291072,\"swapTotal\":8589930496,\"uptime\":\"101h 52m 15.11s (Approximately 4.21 days)\",\"linkmode\":\"dynamic\"},\"store\":{\"configFile\":\"/var/home/marcus/.config/containers/storage.conf\",\"containerStore\":{\"number\":2,\"paused\":0,\"running\":1,\"stopped\":1},\"graphDriverName\":\"overlay\",\"graphOptions\":{},\"graphRoot\":\"/var/home/marcus/.local/share/containers/storage\",\"graphStatus\":{\"Backing Filesystem\":\"btrfs\",\"Native Overlay Diff\":\"true\",\"Supports d_type\":\"true\",\"Using metacopy\":\"false\"},\"imageStore\":{\"number\":1},\"runRoot\":\"/run/user/1000/containers\",\"volumePath\":\"/var/home/marcus/.local/share/containers/storage/volumes\"},\"registries\":{\"search\":[\"registry.fedoraproject.org\",\"registry.access.redhat.com\",\"docker.io\",\"quay.io\"]},\"plugins\":{\"volume\":[\"local\"],\"network\":[\"bridge\",\"macvlan\"],\"log\":[\"k8s-file\",\"none\",\"journald\"]},\"version\":{\"APIVersion\":\"3.4.4\",\"Version\":\"3.4.4\",\"GoVersion\":\"go1.16.8\",\"GitCommit\":\"\",\"BuiltTime\":\"Wed Dec 8 22:45:07 2021\",\"Built\":1638999907,\"OsArch\":\"linux/amd64\"}}"
This seems to be in line with the documentation (https://docs.podman.io/en/latest/_static/api.html?version=v3.4#operation/SystemInfoLibpod).
So it seems HostInfo
is embedded in a bigger data structure and that's why #[serde(skip_serializing_if = "Option::is_none")]
kicks in as no matching fields could be found.
A-system C-bug