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

Move cgroupv1 specific code out of libcontainers/cgroups pkg #2471

Open
kolyshkin opened this issue Jun 15, 2020 · 4 comments
Open

Move cgroupv1 specific code out of libcontainers/cgroups pkg #2471

kolyshkin opened this issue Jun 15, 2020 · 4 comments

Comments

@kolyshkin
Copy link
Contributor

kolyshkin commented Jun 15, 2020

The following public identifiers should be moved from github.com/opencontainers/runc/libcontainer/cgroups to a separate package (say github.com/opencontainers/runc/libcontainer/cgroups/cgroupv1). The reason is, they should only be used from cgroupv1 code (i.e. when cgroups.IsCgroup2UnifiedMode() returns false), and they return errors otherwise.

  • CgroupNamePrefix
  • IsNotFound
  • FindCgroupMountpoint
  • FindCgroupMountpointAndRoot
  • Mount
  • GetOwnCgroup
  • GetCgroupMounts
  • GetOwnCgroup
  • GetOwnCgroupPath
  • GetInitCgroup
  • GetInitCgroupPath

In addition, this one should be made private:

  • NotFoundError
@kolyshkin
Copy link
Contributor Author

Originally tacked in #2411 but the package renaming commit removed for now.

@danishprakash
Copy link
Contributor

@kolyshkin I'd like to work on this if it's something that external contributors can pick up. As you mentioned, the changes you made in libcontainers/cgroups/utils.go still require a package rename, does it make sense for me to start from there?

@kolyshkin
Copy link
Contributor Author

Alas this is more complex than it seems. runc/libcontainer has some external users (kubernetes, cadvisor, k3s etc) and every time we make a refactor like this we have to fix all the users.

I would not touch this :)

@danishprakash
Copy link
Contributor

Makes sense, that being said, would you mind If I ask you to point me to an issue that a new contributor can work on? (bg: been using runc in production for over 2 years now and would really like to contribute back). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants