summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go43
1 files changed, 1 insertions, 42 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 07bb5c6d1..22b398709 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -14,7 +14,6 @@ import (
"syscall"
"time"
- "github.com/containerd/cgroups"
"github.com/containers/storage"
"github.com/containers/storage/pkg/archive"
"github.com/containers/storage/pkg/chrootarchive"
@@ -810,47 +809,6 @@ func (c *Container) prepare() (err error) {
return nil
}
-// cleanupCgroup cleans up residual CGroups after container execution
-// This is a no-op for the systemd cgroup driver
-func (c *Container) cleanupCgroups() error {
- if !c.state.CgroupCreated {
- logrus.Debugf("Cgroups are not present, ignoring...")
- return nil
- }
-
- if c.runtime.config.CgroupManager == SystemdCgroupsManager {
- return nil
- }
-
- // Remove the base path of the container's cgroups
- path := filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-%s", c.ID()))
-
- logrus.Debugf("Removing CGroup %s", path)
-
- cgroup, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(path))
- if err != nil {
- // It's fine for the cgroup to not exist
- // We want it gone, it's gone
- if err == cgroups.ErrCgroupDeleted {
- return nil
- }
-
- return err
- }
-
- if err := cgroup.Delete(); err != nil {
- return err
- }
-
- c.state.CgroupCreated = false
-
- if c.valid {
- return c.save()
- }
-
- return nil
-}
-
// cleanupNetwork unmounts and cleans up the container's network
func (c *Container) cleanupNetwork() error {
if c.state.NetNS == nil {
@@ -1258,6 +1216,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
return nil, errors.Wrapf(err, "error setting up OCI Hooks")
}
}
+
// Bind builtin image volumes
if c.config.Rootfs == "" && c.config.ImageVolumes {
if err := c.addImageVolumes(ctx, &g); err != nil {