diff --git a/crates/runc-shim/src/container.rs b/crates/runc-shim/src/container.rs index bd3bc5ab..1c38d1bb 100644 --- a/crates/runc-shim/src/container.rs +++ b/crates/runc-shim/src/container.rs @@ -18,11 +18,12 @@ use std::collections::HashMap; use async_trait::async_trait; use containerd_shim::{ + api::Status, error::Result, protos::{ api::{CreateTaskRequest, ExecProcessRequest, ProcessInfo, StateResponse}, cgroups::metrics::Metrics, - protobuf::{well_known_types::any::Any, Message, MessageDyn}, + protobuf::{well_known_types::any::Any, EnumOrUnknown, Message, MessageDyn}, shim::oci::ProcessDetails, }, Error, @@ -104,6 +105,12 @@ where async fn state(&self, exec_id: Option<&str>) -> Result { let process = self.get_process(exec_id)?; let mut resp = process.state().await?; + let init_state = self.init.state().await?.status; + if init_state == EnumOrUnknown::new(Status::PAUSING) + || init_state == EnumOrUnknown::new(Status::PAUSED) + { + resp.status = init_state; + } resp.bundle = self.bundle.to_string(); debug!("container state: {:?}", resp); Ok(resp)