Merge pull request #1292 from lifupan/2.0-dev

rustjail: fix the issue of missing destroy contaienr cgroups
This commit is contained in:
Tim Zhang 2021-01-19 22:33:27 +08:00 committed by GitHub
commit f09128d8c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1039,6 +1039,10 @@ impl BaseContainer for LinuxContainer {
MntFlags::MNT_DETACH,
)?;
fs::remove_dir_all(&self.root)?;
if let Some(cgm) = self.cgroup_manager.as_mut() {
cgm.destroy().context("destroy cgroups")?;
}
Ok(())
}