From 1601100b3e9935f4239529c9117c76b8dd5d762a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 11 Jul 2019 13:24:39 +0200 Subject: 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 --- pkg/cgroups/cpu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/cgroups/cpu.go') diff --git a/pkg/cgroups/cpu.go b/pkg/cgroups/cpu.go index 1c8610cc4..03677f1ef 100644 --- a/pkg/cgroups/cpu.go +++ b/pkg/cgroups/cpu.go @@ -68,7 +68,7 @@ func (c *cpuHandler) Create(ctr *CgroupControl) (bool, error) { // Destroy the cgroup func (c *cpuHandler) Destroy(ctr *CgroupControl) error { - return os.Remove(ctr.getCgroupv1Path(CPU)) + return rmDirRecursively(ctr.getCgroupv1Path(CPU)) } // Stat fills a metrics structure with usage stats for the controller -- cgit v1.2.3-54-g00ecf