-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cgroup-info: check if user.slice is valid before accessing value #11463
cgroup-info: check if user.slice is valid before accessing value #11463
Conversation
Prevent hitting `panic: runtime error: index out of range [1] with length 1` while performing `podman info` when unexpected values for user.slice is found. [NO TESTS NEEDED] Signed-off-by: Aditya Rajan <[email protected]>
a7006cf
to
bd64039
Compare
Tentative LGTM, but I would really like to know what's going on such that the cgroup path is invalid |
@mheon For this case If user.slice is invalid falls back to getting subsystem details from parent. |
I think should check it equal to 2 rather than this change |
@zhangguanzhang that should also do the trick.I'll make the change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@giuseppe PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
given the comment: #11461 (comment) I am not sure this is the right fix. Should we skip the line and try with the next one (where the cgroup v2 mount is)? EDIT: nevermind, it should work as it is |
Just to specify if someone else revisits the thread, loop will start processing another line here if first entry is invalid https://github.com/containers/podman/blob/main/pkg/cgroups/cgroups.go#L231 |
Prevent hitting
panic: runtime error: index out of range [1] with length 1
while performing
podman info
and we get unexpected values foruser.slice
.