Skip to content

libct: decouple libct/cg/devices#4248

Merged
lifubang merged 1 commit intoopencontainers:mainfrom
kolyshkin:mv-dev
Apr 26, 2024
Merged

libct: decouple libct/cg/devices#4248
lifubang merged 1 commit intoopencontainers:mainfrom
kolyshkin:mv-dev

Conversation

@kolyshkin
Copy link
Copy Markdown
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
@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.

3 participants