Repository navigation
Conversation
Add Manager.CPUQuota to read the current cgroup's cpu.max through the public API. Return the quota and period in microseconds, using the existing parser's math.MaxInt64 representation for an unlimited quota. Require both fields on reads and preserve file and parsing errors without changing the shared parser's write behavior. Document that ancestor limits are not combined. Cover finite and unlimited quotas, configuration updates, malformed content, read errors, and kernel readback. Add a README usage example. Fixes containerd#377 Assisted-by: Codex Signed-off-by: linrunlong <linrunlong@bytedance.com>
The cgroup v1 jobs fail while installing vagrant-libvirt because fog-json 1.5.0 requires json >= 2.19, but Vagrant has already activated its bundled json 2.7.2. The VM never starts and no tests run. Pin fog-json to 1.2.0 before installing vagrant-libvirt, replacing any previously registered version restored from the Vagrant cache. This follows the fix used in containerd/containerd commit b84460e50769d336bf62dca976eb23f984f7d10b. Assisted-by: Codex Signed-off-by: linrunlong <linrunlong@bytedance.com>
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.
Add
Manager.CPUQuota()to inspect the current cgroup'scpu.max. It returns the quota and period in microseconds, withmath.MaxInt64representing an unlimited quota. The reader preserves file/parse errors and does not combine ancestor limits. Includes README usage, filesystem tests, and kernel readback before and after switching to an unlimited quota.Fixes #377. Replaces #401 after renaming the source branch.
A separate CI commit pins
fog-jsonto 1.2.0 so Vagrant can installvagrant-libvirtwith its bundledjsongem. This follows the fix already used by containerd/containerd. Previously both v1 jobs failed during environment setup, before running tests.Validation
go test -exec sudo -race -count=1 -timeout=5m ./...passed, including real-kernel quota readback. Existing environment-dependent tests were skipped; permission-denied handling passed in a separate non-root run.cgctlbuilds on Go 1.22 and 1.23, both lint jobs, project checks, and generated-file checks.go vet ./..., README example compilation, actionlint, shell syntax, and formatting/diff checks passed.AI assistance: Codex assisted with implementation, tests, documentation, and review.