MCPcopy Create free account
hub / github.com/containerd/cgroups / SingleSubsystem

Function SingleSubsystem

cgroup1/subsystem.go:102–117  ·  view source on GitHub ↗

SingleSubsystem returns a single cgroup subsystem within the base Hierarchy

(baseHierarchy Hierarchy, subsystem Name)

Source from the content-addressed store, hash-verified

100
101// SingleSubsystem returns a single cgroup subsystem within the base Hierarchy
102func SingleSubsystem(baseHierarchy Hierarchy, subsystem Name) Hierarchy {
103 return func() ([]Subsystem, error) {
104 subsystems, err := baseHierarchy()
105 if err != nil {
106 return nil, err
107 }
108 for _, s := range subsystems {
109 if s.Name() == subsystem {
110 return []Subsystem{
111 s,
112 }, nil
113 }
114 }
115 return nil, fmt.Errorf("unable to find subsystem %s", subsystem)
116 }
117}

Callers

nothing calls this directly

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…