opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.73k stars 2.09k forks source link

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

Open kolyshkin opened 4 years ago

kolyshkin commented 4 years ago

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.

In addition, this one should be made private:

kolyshkin commented 4 years ago

Originally tacked in https://github.com/opencontainers/runc/pull/2411 but the package renaming commit removed for now.

danishprakash commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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.