Default returns all the groups in the default cgroups mountpoint in a single hierarchy
()
| 26 | |
| 27 | // Default returns all the groups in the default cgroups mountpoint in a single hierarchy |
| 28 | func Default() ([]Subsystem, error) { |
| 29 | root, err := v1MountPoint() |
| 30 | if err != nil { |
| 31 | return nil, err |
| 32 | } |
| 33 | subsystems, err := defaults(root) |
| 34 | if err != nil { |
| 35 | return nil, err |
| 36 | } |
| 37 | var enabled []Subsystem |
| 38 | for _, s := range pathers(subsystems) { |
| 39 | // check and remove the default groups that do not exist |
| 40 | if _, err := os.Lstat(s.Path("/")); err == nil { |
| 41 | enabled = append(enabled, s) |
| 42 | } |
| 43 | } |
| 44 | return enabled, nil |
| 45 | } |
| 46 | |
| 47 | // v1MountPoint returns the mount point where the cgroup |
| 48 | // mountpoints are mounted in a single hierarchy |
nothing calls this directly
no test coverage detected
searching dependent graphs…