mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-01 17:06:28 +00:00
Merge pull request #10159 from squarti/main
agent: Handle EINVAL error when umounting container rootfs
This commit is contained in:
@@ -1306,7 +1306,14 @@ impl BaseContainer for LinuxContainer {
|
|||||||
.to_string()
|
.to_string()
|
||||||
.as_str(),
|
.as_str(),
|
||||||
MntFlags::MNT_DETACH,
|
MntFlags::MNT_DETACH,
|
||||||
)?;
|
)
|
||||||
|
.or_else(|e| {
|
||||||
|
if e.ne(&nix::Error::EINVAL) {
|
||||||
|
return Err(anyhow!(e));
|
||||||
|
}
|
||||||
|
warn!(self.logger, "rootfs not mounted");
|
||||||
|
Ok(())
|
||||||
|
})?;
|
||||||
fs::remove_dir_all(&self.root)?;
|
fs::remove_dir_all(&self.root)?;
|
||||||
|
|
||||||
let cgm = self.cgroup_manager.as_mut();
|
let cgm = self.cgroup_manager.as_mut();
|
||||||
|
Reference in New Issue
Block a user