diff options
37 files changed, 41 insertions, 70 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index abb55f8c7..7d6471fd4 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -8,11 +8,11 @@ import ( "strconv" "strings" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/libpod/network/types" "github.com/containers/podman/v3/pkg/api/handlers" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/specgen" diff --git a/cmd/podman/containers/pause.go b/cmd/podman/containers/pause.go index 8e1b69d71..1e37bab55 100644 --- a/cmd/podman/containers/pause.go +++ b/cmd/podman/containers/pause.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/utils" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/rootless" "github.com/pkg/errors" diff --git a/cmd/podman/containers/unpause.go b/cmd/podman/containers/unpause.go index e152f70e1..cf37b6369 100644 --- a/cmd/podman/containers/unpause.go +++ b/cmd/podman/containers/unpause.go @@ -4,10 +4,10 @@ import ( "context" "fmt" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/cmd/podman/common" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/utils" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/rootless" "github.com/pkg/errors" diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 871c6787a..d8187c609 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -17,10 +17,10 @@ import ( "github.com/containers/buildah/copier" "github.com/containers/buildah/pkg/overlay" butil "github.com/containers/buildah/util" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/chown" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/ctime" "github.com/containers/podman/v3/pkg/hooks" "github.com/containers/podman/v3/pkg/hooks/exec" diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index f3774a64f..ef9f13f44 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -28,6 +28,7 @@ import ( "github.com/containers/buildah/pkg/overlay" butil "github.com/containers/buildah/util" "github.com/containers/common/pkg/apparmor" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/chown" "github.com/containers/common/pkg/config" "github.com/containers/common/pkg/subscriptions" @@ -36,7 +37,6 @@ import ( "github.com/containers/podman/v3/libpod/events" "github.com/containers/podman/v3/libpod/network/types" "github.com/containers/podman/v3/pkg/annotations" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/checkpoint/crutils" "github.com/containers/podman/v3/pkg/criu" "github.com/containers/podman/v3/pkg/lookup" diff --git a/libpod/info.go b/libpod/info.go index a1db5763a..354364ccc 100644 --- a/libpod/info.go +++ b/libpod/info.go @@ -14,11 +14,11 @@ import ( "github.com/containers/buildah" "github.com/containers/common/pkg/apparmor" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/seccomp" "github.com/containers/image/v5/pkg/sysregistriesv2" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/linkmode" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/storage" "github.com/containers/storage/pkg/system" diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index a83f166a3..5446a8f8a 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -22,11 +22,11 @@ import ( "text/template" "time" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" conmonConfig "github.com/containers/conmon/runner/config" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/logs" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/checkpoint/crutils" "github.com/containers/podman/v3/pkg/errorhandling" "github.com/containers/podman/v3/pkg/rootless" diff --git a/libpod/pod_api.go b/libpod/pod_api.go index feb8ff250..80ecb690a 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -3,9 +3,9 @@ package libpod import ( "context" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/parallel" "github.com/containers/podman/v3/pkg/rootless" "github.com/pkg/errors" diff --git a/libpod/runtime.go b/libpod/runtime.go index 1a22cd09a..9794b3605 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -19,6 +19,7 @@ import ( "github.com/containers/buildah/pkg/parse" "github.com/containers/common/libimage" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/common/pkg/secrets" "github.com/containers/image/v5/pkg/sysregistriesv2" @@ -32,7 +33,6 @@ import ( nettypes "github.com/containers/podman/v3/libpod/network/types" "github.com/containers/podman/v3/libpod/plugin" "github.com/containers/podman/v3/libpod/shutdown" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/systemd" "github.com/containers/podman/v3/pkg/util" diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 05f22c1fe..6c46eb747 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -9,11 +9,11 @@ import ( "time" "github.com/containers/buildah" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" "github.com/containers/podman/v3/libpod/shutdown" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities/reports" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/specgen" diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index 15050ef48..ee59cd8c3 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -9,10 +9,10 @@ import ( "path/filepath" "strings" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/specgen" spec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/libpod/stats.go b/libpod/stats.go index cc1250e83..879ae7207 100644 --- a/libpod/stats.go +++ b/libpod/stats.go @@ -8,8 +8,8 @@ import ( "syscall" "time" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/pkg/errors" ) diff --git a/libpod/util_linux.go b/libpod/util_linux.go index e2ea97185..ef871ef3d 100644 --- a/libpod/util_linux.go +++ b/libpod/util_linux.go @@ -7,8 +7,8 @@ import ( "strings" "syscall" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" diff --git a/pkg/api/handlers/compat/containers_stats.go b/pkg/api/handlers/compat/containers_stats.go index 0051e7235..a92fe9fe0 100644 --- a/pkg/api/handlers/compat/containers_stats.go +++ b/pkg/api/handlers/compat/containers_stats.go @@ -5,11 +5,11 @@ import ( "net/http" "time" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/pkg/api/handlers/utils" api "github.com/containers/podman/v3/pkg/api/types" - "github.com/containers/podman/v3/pkg/cgroups" docker "github.com/docker/docker/api/types" "github.com/gorilla/schema" "github.com/pkg/errors" diff --git a/pkg/api/handlers/libpod/containers_stats.go b/pkg/api/handlers/libpod/containers_stats.go index 084f1252d..016214aa2 100644 --- a/pkg/api/handlers/libpod/containers_stats.go +++ b/pkg/api/handlers/libpod/containers_stats.go @@ -4,10 +4,10 @@ import ( "encoding/json" "net/http" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/pkg/api/handlers/utils" api "github.com/containers/podman/v3/pkg/api/types" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/domain/infra/abi" "github.com/containers/podman/v3/pkg/rootless" diff --git a/pkg/cgroups/cgroups_test.go b/pkg/cgroups/cgroups_test.go deleted file mode 100644 index 22d5efb76..000000000 --- a/pkg/cgroups/cgroups_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package cgroups - -import ( - "testing" - - "github.com/containers/podman/v3/pkg/rootless" - spec "github.com/opencontainers/runtime-spec/specs-go" -) - -func TestCreated(t *testing.T) { - // tests only works in rootless mode - if rootless.IsRootless() { - return - } - - var resources spec.LinuxResources - cgr, err := New("machine.slice", &resources) - if err != nil { - t.Error(err) - } - if err := cgr.Delete(); err != nil { - t.Error(err) - } - - cgr, err = NewSystemd("machine.slice") - if err != nil { - t.Error(err) - } - if err := cgr.Delete(); err != nil { - t.Error(err) - } -} diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 631eb3a43..d1af4a479 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -10,13 +10,13 @@ import ( "time" "github.com/containers/buildah" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/image/v5/manifest" "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/events" "github.com/containers/podman/v3/libpod/logs" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/checkpoint" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/domain/entities/reports" diff --git a/pkg/domain/infra/abi/pods_stats.go b/pkg/domain/infra/abi/pods_stats.go index abb15bd1f..70f953fd4 100644 --- a/pkg/domain/infra/abi/pods_stats.go +++ b/pkg/domain/infra/abi/pods_stats.go @@ -4,8 +4,8 @@ import ( "context" "fmt" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/utils" diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index e6c9d850b..02b4181f5 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -8,9 +8,9 @@ import ( "os/exec" "path/filepath" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/domain/entities/reports" "github.com/containers/podman/v3/pkg/rootless" diff --git a/pkg/domain/infra/runtime_libpod.go b/pkg/domain/infra/runtime_libpod.go index 90eb6abeb..b307d04b3 100644 --- a/pkg/domain/infra/runtime_libpod.go +++ b/pkg/domain/infra/runtime_libpod.go @@ -9,9 +9,9 @@ import ( "os/signal" "sync" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/cmd/podman/utils" "github.com/containers/podman/v3/libpod" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/podman/v3/pkg/namespaces" "github.com/containers/podman/v3/pkg/rootless" diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go index df5788099..9f8807915 100644 --- a/pkg/specgen/generate/oci.go +++ b/pkg/specgen/generate/oci.go @@ -6,10 +6,10 @@ import ( "strings" "github.com/containers/common/libimage" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" "github.com/containers/podman/v3/libpod" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/specgen" spec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/specgen/generate/validate.go b/pkg/specgen/generate/validate.go index b0d84825e..a44bf9979 100644 --- a/pkg/specgen/generate/validate.go +++ b/pkg/specgen/generate/validate.go @@ -4,8 +4,8 @@ import ( "os" "path/filepath" + "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/sysinfo" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/specgen" "github.com/containers/podman/v3/utils" "github.com/pkg/errors" diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go index 2f4c48811..bb5385ef1 100644 --- a/pkg/specgen/namespaces.go +++ b/pkg/specgen/namespaces.go @@ -5,7 +5,7 @@ import ( "os" "strings" - "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/util" "github.com/containers/storage" diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index a411a860b..6e1a62b99 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/podman/v3/pkg/inspect" "github.com/containers/podman/v3/pkg/rootless" . "github.com/containers/podman/v3/test/utils" diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index f063c79e9..8db23080e 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -12,7 +12,7 @@ import ( "syscall" "time" - "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" . "github.com/containers/podman/v3/test/utils" "github.com/containers/storage/pkg/stringid" diff --git a/utils/utils.go b/utils/utils.go index 80eed7536..095370a08 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -12,8 +12,8 @@ import ( "strings" "sync" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/libpod/define" - "github.com/containers/podman/v3/pkg/cgroups" "github.com/containers/storage/pkg/archive" "github.com/godbus/dbus/v5" "github.com/pkg/errors" diff --git a/utils/utils_supported.go b/utils/utils_supported.go index 0f0c9a9ba..be200509b 100644 --- a/utils/utils_supported.go +++ b/utils/utils_supported.go @@ -11,7 +11,7 @@ import ( "path/filepath" "strings" - "github.com/containers/podman/v3/pkg/cgroups" + "github.com/containers/common/pkg/cgroups" "github.com/containers/podman/v3/pkg/rootless" systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/godbus/dbus/v5" diff --git a/pkg/cgroups/blkio.go b/vendor/github.com/containers/common/pkg/cgroups/blkio.go index bacd4eb93..bacd4eb93 100644 --- a/pkg/cgroups/blkio.go +++ b/vendor/github.com/containers/common/pkg/cgroups/blkio.go diff --git a/pkg/cgroups/cgroups.go b/vendor/github.com/containers/common/pkg/cgroups/cgroups.go index d0c090012..d0bcd8bfd 100644 --- a/pkg/cgroups/cgroups.go +++ b/vendor/github.com/containers/common/pkg/cgroups/cgroups.go @@ -3,6 +3,7 @@ package cgroups import ( "bufio" "bytes" + "context" "fmt" "io/ioutil" "math" @@ -11,7 +12,7 @@ import ( "strconv" "strings" - "github.com/containers/podman/v3/pkg/rootless" + "github.com/containers/storage/pkg/unshare" systemdDbus "github.com/coreos/go-systemd/v22/dbus" "github.com/godbus/dbus/v5" spec "github.com/opencontainers/runtime-spec/specs-go" @@ -131,12 +132,12 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool) controllers := []controller{} controllersFile := cgroupRoot + "/cgroup.controllers" // rootless cgroupv2: check available controllers for current user, systemd or servicescope will inherit - if rootless.IsRootless() { + if unshare.IsRootless() { userSlice, err := getCgroupPathForCurrentProcess() if err != nil { return controllers, err } - //userSlice already contains '/' so not adding here + // userSlice already contains '/' so not adding here basePath := cgroupRoot + userSlice controllersFile = fmt.Sprintf("%s/cgroup.controllers", basePath) } @@ -157,7 +158,7 @@ func getAvailableControllers(exclude map[string]controllerHandler, cgroup2 bool) subsystems, _ := cgroupV1GetAllSubsystems() controllers := []controller{} // cgroupv1 and rootless: No subsystem is available: delegation is unsafe. - if rootless.IsRootless() { + if unshare.IsRootless() { return controllers, nil } @@ -435,7 +436,7 @@ func Load(path string) (*CgroupControl, error) { // if there is no controller at all, raise an error if !oneExists { - if rootless.IsRootless() { + if unshare.IsRootless() { return nil, ErrCgroupV1Rootless } // compatible with the error code @@ -452,7 +453,7 @@ func (c *CgroupControl) CreateSystemdUnit(path string) error { return fmt.Errorf("the cgroup controller is not using systemd") } - conn, err := systemdDbus.New() + conn, err := systemdDbus.NewWithContext(context.TODO()) if err != nil { return err } @@ -461,10 +462,10 @@ func (c *CgroupControl) CreateSystemdUnit(path string) error { return systemdCreate(path, conn) } -// GetUserConnection returns a user connection to D-BUS +// GetUserConnection returns an user connection to D-BUS func GetUserConnection(uid int) (*systemdDbus.Conn, error) { return systemdDbus.NewConnection(func() (*dbus.Conn, error) { - return dbusAuthConnection(uid, dbus.SessionBusPrivateNoAutoStartup) + return dbusAuthConnection(uid, dbus.SessionBusPrivate) }) } @@ -565,7 +566,7 @@ func (c *CgroupControl) DeleteByPathConn(path string, conn *systemdDbus.Conn) er // DeleteByPath deletes the specified cgroup path func (c *CgroupControl) DeleteByPath(path string) error { if c.systemd { - conn, err := systemdDbus.New() + conn, err := systemdDbus.NewWithContext(context.TODO()) if err != nil { return err } diff --git a/pkg/cgroups/cgroups_supported.go b/vendor/github.com/containers/common/pkg/cgroups/cgroups_supported.go index fe17db7f7..fe17db7f7 100644 --- a/pkg/cgroups/cgroups_supported.go +++ b/vendor/github.com/containers/common/pkg/cgroups/cgroups_supported.go diff --git a/pkg/cgroups/cgroups_unsupported.go b/vendor/github.com/containers/common/pkg/cgroups/cgroups_unsupported.go index cd140fbf3..cd140fbf3 100644 --- a/pkg/cgroups/cgroups_unsupported.go +++ b/vendor/github.com/containers/common/pkg/cgroups/cgroups_unsupported.go diff --git a/pkg/cgroups/cpu.go b/vendor/github.com/containers/common/pkg/cgroups/cpu.go index 23539757d..23539757d 100644 --- a/pkg/cgroups/cpu.go +++ b/vendor/github.com/containers/common/pkg/cgroups/cpu.go diff --git a/pkg/cgroups/cpuset.go b/vendor/github.com/containers/common/pkg/cgroups/cpuset.go index 46d0484f2..22ac0a079 100644 --- a/pkg/cgroups/cpuset.go +++ b/vendor/github.com/containers/common/pkg/cgroups/cpuset.go @@ -26,7 +26,7 @@ func cpusetCopyFileFromParent(dir, file string, cgroupv2 bool) ([]byte, error) { if err != nil { return nil, errors.Wrapf(err, "open %s", path) } - if len(strings.Trim(string(data), "\n")) != 0 { + if strings.Trim(string(data), "\n") != "" { return data, nil } data, err = cpusetCopyFileFromParent(filepath.Dir(dir), file, cgroupv2) diff --git a/pkg/cgroups/memory.go b/vendor/github.com/containers/common/pkg/cgroups/memory.go index b3991f7e3..b3991f7e3 100644 --- a/pkg/cgroups/memory.go +++ b/vendor/github.com/containers/common/pkg/cgroups/memory.go diff --git a/pkg/cgroups/pids.go b/vendor/github.com/containers/common/pkg/cgroups/pids.go index b2bfebe4d..b2bfebe4d 100644 --- a/pkg/cgroups/pids.go +++ b/vendor/github.com/containers/common/pkg/cgroups/pids.go diff --git a/pkg/cgroups/systemd.go b/vendor/github.com/containers/common/pkg/cgroups/systemd.go index f26988c5a..92065a2d7 100644 --- a/pkg/cgroups/systemd.go +++ b/vendor/github.com/containers/common/pkg/cgroups/systemd.go @@ -1,6 +1,7 @@ package cgroups import ( + "context" "fmt" "path/filepath" "strings" @@ -37,7 +38,7 @@ func systemdCreate(path string, c *systemdDbus.Conn) error { } ch := make(chan string) - _, err := c.StartTransientUnit(name, "replace", properties, ch) + _, err := c.StartTransientUnitContext(context.TODO(), name, "replace", properties, ch) if err != nil { lastError = err continue @@ -70,7 +71,7 @@ func systemdDestroyConn(path string, c *systemdDbus.Conn) error { name := filepath.Base(path) ch := make(chan string) - _, err := c.StopUnit(name, "replace", ch) + _, err := c.StopUnitContext(context.TODO(), name, "replace", ch) if err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 076f93039..b5cc6083c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -114,6 +114,7 @@ github.com/containers/common/pkg/apparmor github.com/containers/common/pkg/apparmor/internal/supported github.com/containers/common/pkg/auth github.com/containers/common/pkg/capabilities +github.com/containers/common/pkg/cgroups github.com/containers/common/pkg/cgroupv2 github.com/containers/common/pkg/chown github.com/containers/common/pkg/completion |