Fix: Podman cli status & memory - #3804
Merged
Merged
Conversation
ipspace
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
netlab status --memoryfor Podman runtimeWhen using
defaults.providers.clab.runtime: podman, thenetlab statusandnetlab status --memorycommands showed no container status or memory usage.Root cause
Podman's Docker-compatible CLI returns JSON differently from Docker:
docker ps --format jsonNamesfielddocker stats --format jsonName,MemUsagename,mem_usageKiB,MiB,GiB)kB,MB,GB)Changes
providers/clab/__init__.pyget_lab_status: ifdocker psoutput is a JSON array (Podman), normalize itto Docker's per-line format and unwrap
Namesfrom list to string beforerunning the existing parsing logic unchanged.
add_memory_usage: same normalization fordocker stats— map Podman'sname/mem_usagefields to Docker'sName/MemUsage, then parse andre-format the value in binary units (MiB/GiB) so the memory column is
consistent across Docker, Podman, and libvirt VMs.
utils/strings.pyMEMORY_UNITS: added decimal SI units (KB,MB,GB,TB) alongsidethe existing binary ones, with correct byte-to-KiB conversion factors.
parse_memory_size: extended the regex to also match decimal unit suffixes(
[KMGT]B).