Skip to content

Commit

Permalink
tests/cmd/sd-helper: switch from configs to cgroups
Browse files Browse the repository at this point in the history
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Dec 12, 2024
1 parent 4923bbb commit 42b4daa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/cmd/sd-helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -57,18 +56,18 @@ 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, "")
}
return systemd.NewLegacyManager(config, nil)
}

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 {
Expand Down

0 comments on commit 42b4daa

Please sign in to comment.