diff --git a/src/agent/src/rpc.rs b/src/agent/src/rpc.rs index f072434f2e..3bcdf54420 100644 --- a/src/agent/src/rpc.rs +++ b/src/agent/src/rpc.rs @@ -312,19 +312,14 @@ impl AgentService { let pipe_size = AGENT_CONFIG.container_pipe_size; - let p = if let Some(p) = oci.process() { - { - let new_p = - confidential_data_hub::image::get_process(p, &oci, req.storages.clone())?; - Process::new(&sl(), &new_p, cid.as_str(), true, pipe_size, proc_io)? - } - - Process::new(&sl(), p, cid.as_str(), true, pipe_size, proc_io)? - } else { + let Some(p) = oci.process() else { info!(sl(), "no process configurations!"); return Err(anyhow!(nix::Error::EINVAL)); }; + let new_p = confidential_data_hub::image::get_process(p, &oci, req.storages.clone())?; + let p = Process::new(&sl(), &new_p, cid.as_str(), true, pipe_size, proc_io)?; + // if starting container failed, we will do some rollback work // to ensure no resources are leaked. if let Err(err) = ctr.start(p).await {