Support the cgroup service field - #1519
Open
Sanjays2402 wants to merge 2 commits into
Open
Conversation
The Compose Specification `cgroup` service field (`host` or `private`) was silently dropped: `container_to_args` never read it, so a service declaring `cgroup: host` was started in a private cgroup namespace while docker-compose puts it in the host namespace. Map the field onto `podman run --cgroupns`, and reject any other value with a ValueError, mirroring how the neighbouring `ipc` option is validated. Added unit tests covering both valid modes and the invalid-value error.
p12tic
requested changes
Aug 10, 2026
p12tic
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks. Please add a release note.
Author
|
Added the requested release note in b40659d: newsfragments/cgroup-service-field.feature. It describes the new Compose cgroup service field support and the host/private --cgroupns modes. The focused container_to_args suite is green (80 passed). |
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 #1439
Contributor Checklist:
The Compose Specification
cgroupservice field was silently dropped, socgroup: hoststill started the container in a private cgroup namespace while docker-compose puts it in the host namespace. It is now mapped topodman run --cgroupns, with any other value rejected the same way the neighbouringipcoption validates its input.Unit tests added in
tests/unit/test_container_to_args.pycover both valid modes and the invalid-value error; they fail without the change and pass with it.Let me know if you'd like a
newsfragments/entry added for this and I'll push one.