From 79cf38e6ea83b91714e8a395f836fe9bd770b25d Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Mon, 12 Dec 2022 11:07:14 +0000 Subject: [PATCH] runtime-rs: clear OCI spec namespace path None of the host namespace paths make sense in the guest. Let's clear them all before sending the spec to the agent. Signed-off-by: Peng Tao --- .../virt_container/src/container_manager/container.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/container.rs b/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/container.rs index b41c8c732c..764eba08ce 100644 --- a/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/container.rs +++ b/src/runtime-rs/crates/runtimes/virt_container/src/container_manager/container.rs @@ -403,7 +403,10 @@ fn amend_spec(spec: &mut oci::Spec, disable_guest_seccomp: bool) -> Result<()> { for n in linux.namespaces.iter() { match n.r#type.as_str() { oci::PIDNAMESPACE | oci::NETWORKNAMESPACE => continue, - _ => ns.push(n.clone()), + _ => ns.push(oci::LinuxNamespace { + r#type: n.r#type.clone(), + path: "".to_string(), + }), } }