Skip to content

Cgroup2: Map OCI spec unlimited sentinel values to "max"#620

Open
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:cg2-ocispec-unlimited
Open

Cgroup2: Map OCI spec unlimited sentinel values to "max"#620
dcantah wants to merge 1 commit intoapple:mainfrom
dcantah:cg2-ocispec-unlimited

Conversation

@dcantah
Copy link
Copy Markdown
Member

@dcantah dcantah commented Mar 31, 2026

The OCI runtime spec uses -1 for memory.limit and pids.limit to mean "unlimited". The cgroup v2 kernel interface rejects literal "-1" and expects the string "max" instead, causing EINVAL on container startup. Translate negative values to "max" before writing.

Also flatten a needlessly nested if let in the CPU resource block.

The OCI runtime spec uses -1 for memory.limit and pids.limit to mean
"unlimited". The cgroup v2 kernel interface rejects literal "-1" and
expects the string "max" instead, causing EINVAL on container startup.
Translate negative values to "max" before writing.

Also flatten a needlessly nested `if let` in the CPU resource block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant