Skip to content
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

Improve cgroup path handling for rootless containers #597

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

Furisto
Copy link
Collaborator

@Furisto Furisto commented Jan 6, 2022

  • Ensure that a valid cgroup path is created for rootless containers if the cgroup path is not specified
  • Handle that a cgroup path without a parent is provided

See #595

@Will-Shanks
Copy link

This PR fixes #595

@utam0k utam0k added the bug label Jan 10, 2022
@Furisto Furisto marked this pull request as ready for review January 10, 2022 18:44
@Furisto
Copy link
Collaborator Author

Furisto commented Jan 10, 2022

Thanks for the confirmation @Will-Shanks.

@Furisto Furisto requested a review from utam0k January 10, 2022 18:45
Comment on lines +80 to +92
let destructured_path = match parts.len() {
2 => CgroupsPath {
parent: "".to_owned(),
prefix: parts[0].to_owned(),
name: parts[1].to_owned(),
},
3 => CgroupsPath {
parent: parts[0].to_owned(),
prefix: parts[1].to_owned(),
name: parts[2].to_owned(),
},
_ => bail!("cgroup path {:?} is invalid", cgroups_path),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I looked for to avoid specifying an index of the array, I didn't find out 😭

@utam0k
Copy link
Member

utam0k commented Jan 11, 2022

Looks good!

@utam0k utam0k merged commit 52f83a0 into youki-dev:main Jan 11, 2022
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.

3 participants