MCPcopy
hub / github.com/opencontainers/runc / unitCommand

Function unitCommand

tests/cmd/sd-helper/helper.go:70–89  ·  view source on GitHub ↗
(cmd, name, parent string)

Source from the content-addressed store, hash-verified

68}
69
70func 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}

Callers 1

mainFunction · 0.85

Calls 3

newManagerFunction · 0.70
ApplyMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…