Krikri::PluginHelpers::DockerResources
DockerResources - pure logic for parsing docker_container's memory/cpu resource-limit params. No I/O here - docker_container.cr does the actual API calls.
Constants
Binary (1024-based) size suffixes, matching real Ansible's own
human_to_bytes (SIZE_RANGES in
ansible/module_utils/common/text/formatters.py) - K/M/G/T/P are
KiB/MiB/GiB/TiB/PiB despite the non-"i" spelling, not decimal
1000-based units.
Class methods
Matches real Ansible's own _preprocess_cpus: cpus: is a
float number of CPUs, converted to Docker's own NanoCpus
(nanocpus = cpus * 1e9, rounded).
Matches real Ansible's own human_to_bytes: a bare number with
no unit suffix is returned as-is (already bytes); a number
followed by a unit letter (only the first letter matters - "MB"/
"M" are equivalent, matching the real function's own
unit[0].upper()) is converted. Raises with the real function's
own error message shape on anything unparseable.