diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-06-19 11:13:18 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-06-26 13:17:02 +0200 |
commit | 72cf0c81e86435c1c8daed9bff183b20d6bc400c (patch) | |
tree | 09ce3687ec7977ac2a027639e376db3586979bc2 /libpod/runtime_pod_linux.go | |
parent | fa1869381301797295dece0aec12435fc902295b (diff) | |
download | podman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.tar.gz podman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.tar.bz2 podman-72cf0c81e86435c1c8daed9bff183b20d6bc400c.zip |
libpod: use pkg/cgroups instead of containerd/cgroups
use the new implementation for dealing with cgroups.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index d1d303ad5..11dc8cd44 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -9,9 +9,9 @@ import ( "path/filepath" "strings" - "github.com/containerd/cgroups" "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/events" + "github.com/containers/libpod/pkg/cgroups" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -183,9 +183,8 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) // would prevent removing the CGroups. if p.runtime.config.CgroupManager == CgroupfsCgroupsManager { // Get the conmon CGroup - v1CGroups := GetV1CGroups(getExcludedCGroups()) conmonCgroupPath := filepath.Join(p.state.CgroupPath, "conmon") - conmonCgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(conmonCgroupPath)) + conmonCgroup, err := cgroups.Load(conmonCgroupPath) if err != nil && err != cgroups.ErrCgroupDeleted { if removalErr == nil { removalErr = errors.Wrapf(err, "error retrieving pod %s conmon cgroup %s", p.ID(), conmonCgroupPath) @@ -250,9 +249,8 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) // Make sure the conmon cgroup is deleted first // Since the pod is almost gone, don't bother failing // hard - instead, just log errors. - v1CGroups := GetV1CGroups(getExcludedCGroups()) conmonCgroupPath := filepath.Join(p.state.CgroupPath, "conmon") - conmonCgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(conmonCgroupPath)) + conmonCgroup, err := cgroups.Load(conmonCgroupPath) if err != nil && err != cgroups.ErrCgroupDeleted { if removalErr == nil { removalErr = errors.Wrapf(err, "error retrieving pod %s conmon cgroup", p.ID()) @@ -269,7 +267,7 @@ func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) } } } - cgroup, err := cgroups.Load(v1CGroups, cgroups.StaticPath(p.state.CgroupPath)) + cgroup, err := cgroups.Load(p.state.CgroupPath) if err != nil && err != cgroups.ErrCgroupDeleted { if removalErr == nil { removalErr = errors.Wrapf(err, "error retrieving pod %s cgroup", p.ID()) |