mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
agent: fix the issue of setup sandbox pidns
When the sandbox api was enabled, the pasue container wouldn't be created, thus the shared sandbox pidns should be fallbacked to the first container's init process, instead of return any error here. Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit is contained in:
@@ -1750,7 +1750,7 @@ fn update_container_namespaces(
|
||||
if !pidns.path.is_empty() {
|
||||
pid_ns.set_path(Some(PathBuf::from(&pidns.path)));
|
||||
}
|
||||
} else {
|
||||
} else if !sandbox.containers.is_empty() {
|
||||
return Err(anyhow!(ERR_NO_SANDBOX_PIDNS));
|
||||
}
|
||||
}
|
||||
@@ -2527,14 +2527,6 @@ mod tests {
|
||||
.unwrap()],
|
||||
..Default::default()
|
||||
},
|
||||
TestData {
|
||||
namespaces: vec![],
|
||||
sandbox_pidns_path: None,
|
||||
use_sandbox_pidns: true,
|
||||
result: Err(anyhow!(ERR_NO_SANDBOX_PIDNS)),
|
||||
expected_namespaces: vec![],
|
||||
..Default::default()
|
||||
},
|
||||
TestData {
|
||||
has_linux_in_spec: false,
|
||||
result: Err(anyhow!(ERR_NO_LINUX_FIELD)),
|
||||
|
Reference in New Issue
Block a user