opencontainers / opencontainers/runc

Move cgroupv1 specific code out of libcontainers/cgroups pkg

Open
#2,471 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/cgroupv1 kind/refactor
Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the public identifiers in github.com/opencontainers/runc/libcontainer/cgroups and all repository references to them. Trace the cgroupv1 and cgroupv2 call paths before moving the listed cgroupv1 identifiers into libcontainer/cgroups/cgroupv1. Done means callers use the new package and NotFoundError is no longer public.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.