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

libct: decouple libct/cg/devices #4248

Merged
merged 1 commit into from
Apr 26, 2024
Merged

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Apr 17, 2024

This is the last step of refactoring done in #3452, which is needed to use runc/libct v1.2 in kubernetes and other libcontainer users (to avoid massive cilium/ebpf dependency).


Commit b6967fa moved the functionality of managing cgroup devices into a separate package, and decoupled libcontainer/cgroups from it.

Yet, some software (e.g. cadvisor) may need to use libcontainer package, which imports libcontainer/cgroups/devices, thus making it impossible to use libcontainer without bringing in cgroup/devices dependency.

In fact, we only need to manage devices in runc binary, so move the import to main.go.

The need to import libct/cg/dev in order to manage devices is already documented in libcontainer/cgroups. Let's improve that:

  • update that documentation;
  • add a similar note to libcontainer/cgroups/systemd;
  • add a note to libct README.

Commit b6967fa moved the functionality of managing cgroup devices
into a separate package, and decoupled libcontainer/cgroups from it.

Yet, some software (e.g. cadvisor) may need to use libcontainer package,
which imports libcontainer/cgroups/devices, thus making it impossible to
use libcontainer without bringing in cgroup/devices dependency.

In fact, we only need to manage devices in runc binary, so move the
import to main.go.

The need to import libct/cg/dev in order to manage devices is already
documented in libcontainer/cgroups, but let's
 - update that documentation;
 - add a similar note to libcontainer/cgroups/systemd;
 - add a note to libct README.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added this to the 1.2.0 milestone Apr 17, 2024
@kolyshkin kolyshkin marked this pull request as ready for review April 17, 2024 23:19
@lifubang lifubang merged commit 426c04b into opencontainers:main Apr 26, 2024
38 checks passed
@lifubang lifubang mentioned this pull request Jun 10, 2024
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.

None yet

3 participants