mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/cmd/sd-helper: switch from configs to cgroups
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups/systemd"
|
||||
"github.com/opencontainers/runc/libcontainer/configs"
|
||||
)
|
||||
|
||||
func usage() {
|
||||
@@ -57,7 +56,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func newManager(config *configs.Cgroup) (cgroups.Manager, error) {
|
||||
func newManager(config *cgroups.Cgroup) (cgroups.Manager, error) {
|
||||
if cgroups.IsCgroup2UnifiedMode() {
|
||||
return systemd.NewUnifiedManager(config, "")
|
||||
}
|
||||
@@ -65,10 +64,10 @@ func newManager(config *configs.Cgroup) (cgroups.Manager, error) {
|
||||
}
|
||||
|
||||
func unitCommand(cmd, name, parent string) error {
|
||||
podConfig := &configs.Cgroup{
|
||||
podConfig := &cgroups.Cgroup{
|
||||
Name: name,
|
||||
Parent: parent,
|
||||
Resources: &configs.Resources{},
|
||||
Resources: &cgroups.Resources{},
|
||||
}
|
||||
pm, err := newManager(podConfig)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user