diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-11 13:24:39 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-07-11 18:07:48 +0200 |
commit | 1601100b3e9935f4239529c9117c76b8dd5d762a (patch) | |
tree | 6f93fdd5a38d5aebf73170d106de0d6c232d6576 /pkg/cgroups/cpuset.go | |
parent | 144567b42dba2c8c426538a4b5fe7d718b43284a (diff) | |
download | podman-1601100b3e9935f4239529c9117c76b8dd5d762a.tar.gz podman-1601100b3e9935f4239529c9117c76b8dd5d762a.tar.bz2 podman-1601100b3e9935f4239529c9117c76b8dd5d762a.zip |
cgroups: attempt a recursive rmdir
if the cgroup cannot be deleted, then attempt to delete all its
subdirectories and try again.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/cgroups/cpuset.go')
-rw-r--r-- | pkg/cgroups/cpuset.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/cgroups/cpuset.go b/pkg/cgroups/cpuset.go index 25d2f7f76..46d0484f2 100644 --- a/pkg/cgroups/cpuset.go +++ b/pkg/cgroups/cpuset.go @@ -3,7 +3,6 @@ package cgroups import ( "fmt" "io/ioutil" - "os" "path/filepath" "strings" @@ -77,7 +76,7 @@ func (c *cpusetHandler) Create(ctr *CgroupControl) (bool, error) { // Destroy the cgroup func (c *cpusetHandler) Destroy(ctr *CgroupControl) error { - return os.Remove(ctr.getCgroupv1Path(CPUset)) + return rmDirRecursively(ctr.getCgroupv1Path(CPUset)) } // Stat fills a metrics structure with usage stats for the controller |