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

Method subsystemsFilter

cgroup1/cgroup.go:156–172  ·  view source on GitHub ↗
(subsystems ...Name)

Source from the content-addressed store, hash-verified

154}
155
156func (c *cgroup) subsystemsFilter(subsystems ...Name) []Subsystem {
157 if len(subsystems) == 0 {
158 return c.subsystems
159 }
160
161 filteredSubsystems := []Subsystem{}
162 for _, s := range c.subsystems {
163 for _, f := range subsystems {
164 if s.Name() == f {
165 filteredSubsystems = append(filteredSubsystems, s)
166 break
167 }
168 }
169 }
170
171 return filteredSubsystems
172}
173
174// Add moves the provided process into the new cgroup.
175// Without additional arguments, the process is added to all the cgroup subsystems.

Callers 1

addMethod · 0.95

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected