fix(quadlet): emit CPU resource limits via PodmanArgs#423
Merged
Conversation
generate quadlet silently dropped all CPU limits (cpus, cpuset, cpu_shares, cpu_quota, cpu_period) — neither emitted nor warned, while memory and pids limits were honored. CPU has no native [Container] Quadlet key in Podman 5.x, so route it through PodmanArgs= exactly like --memory, with cpus falling back to deploy.resources.limits.cpus. Verified with a real generate: a service with cpus/cpuset/cpu_shares now yields the matching PodmanArgs lines. Adds unit tests for the service-level keys and the deploy fallback. Closes #408 Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
This was referenced Jun 17, 2026
Jaro-c
added a commit
that referenced
this pull request
Jun 17, 2026
…CPU/tmpfs, NOTICE) (#425) Promote verified develop fixes to main (merge, **no tag** — not a release; tag is cut later when releasing). Brings to main: - #421 (closes #417, P1): synthesize `<project>_default` network so services with no `networks:` block resolve each other by name. Real-Podman verified. - #422 (#418 item 1): `deploy.restart_policy.condition: any` → `always`. - #423 (closes #408): quadlet emits CPU limits via `PodmanArgs=`. - #424 (#419 item 1): quadlet long-form tmpfs → `Tmpfs=`. - #409: NOTICE `podman-compose` → `podup`. All merged to develop individually with CI green + unit/integration tests. No public API change (bug fixes); no version bump, no release.
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.
Closes #408.
Problem
generate quadletsilently dropped all CPU limits (cpus,cpuset,cpu_shares,cpu_quota,cpu_period) — neither emitted nor warned — whilemem_limit/pids_limitwere honored. Inconsistent and surprising: an operator'scpus: "2"had no effect in the generated unit.Fix
CPU has no native
[Container]Quadlet key in Podman 5.x (unlikeMemory=/PidsLimit=), so route it throughPodmanArgs=, mirroring the existing--memoryhandling.cpusfalls back todeploy.resources.limits.cpus.Verification
Real
podup generate quadleton a service withcpus/cpuset/cpu_sharesnow emits:Unit tests cover the five service-level keys and the deploy fallback.
cargo fmt/clippyclean.Note
internal/quadlet/unit.rsis now at 490/500 lines. The broader quadlet sweep (#419) will need to split this file to stay under the line-limit gate.