mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-21 22:44:27 +01:00
rustjail: fix the issue of missing destroy contaienr cgroups
In the container's destroy method, it should destroy the container's cgroups. Fixes: #1291 Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
This commit is contained in:
@@ -968,6 +968,10 @@ impl BaseContainer for LinuxContainer {
|
|||||||
MntFlags::MNT_DETACH,
|
MntFlags::MNT_DETACH,
|
||||||
)?;
|
)?;
|
||||||
fs::remove_dir_all(&self.root)?;
|
fs::remove_dir_all(&self.root)?;
|
||||||
|
|
||||||
|
if let Some(cgm) = self.cgroup_manager.as_mut() {
|
||||||
|
cgm.destroy().context("destroy cgroups")?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user