(cmd, name, parent string)
| 68 | } |
| 69 | |
| 70 | func unitCommand(cmd, name, parent string) error { |
| 71 | podConfig := &cgroups.Cgroup{ |
| 72 | Name: name, |
| 73 | Parent: parent, |
| 74 | Resources: &cgroups.Resources{}, |
| 75 | } |
| 76 | pm, err := newManager(podConfig) |
| 77 | if err != nil { |
| 78 | return err |
| 79 | } |
| 80 | |
| 81 | switch cmd { |
| 82 | case "start": |
| 83 | return pm.Apply(-1) |
| 84 | case "stop": |
| 85 | return pm.Destroy() |
| 86 | } |
| 87 | |
| 88 | return fmt.Errorf("unknown command: %s", cmd) |
| 89 | } |
no test coverage detected
searching dependent graphs…