Construct a `DriverSandbox` from common fields. Centralises the boilerplate that every event/inspect/list path shares: `namespace`, `spec`, `agent_fd`, and `sandbox_fd` are always empty in the Podman driver.
(
sandbox_id: String,
sandbox_name: String,
instance_name: String,
instance_id: String,
condition: DriverCondition,
deleting: bool,
)
| 245 | /// `namespace`, `spec`, `agent_fd`, and `sandbox_fd` are always empty in |
| 246 | /// the Podman driver. |
| 247 | fn build_driver_sandbox( |
| 248 | sandbox_id: String, |
| 249 | sandbox_name: String, |
| 250 | instance_name: String, |
| 251 | instance_id: String, |
| 252 | condition: DriverCondition, |
| 253 | deleting: bool, |
| 254 | ) -> DriverSandbox { |
| 255 | DriverSandbox { |
| 256 | id: sandbox_id, |
| 257 | name: sandbox_name, |
| 258 | namespace: String::new(), |
| 259 | spec: None, |
| 260 | status: Some(DriverSandboxStatus { |
| 261 | sandbox_name: instance_name, |
| 262 | instance_id, |
| 263 | agent_fd: String::new(), |
| 264 | sandbox_fd: String::new(), |
| 265 | conditions: vec![condition], |
| 266 | deleting, |
| 267 | }), |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /// Build a `DriverSandbox` from a container inspection result. |
| 272 | pub fn driver_sandbox_from_inspect(inspect: &ContainerInspect) -> Option<DriverSandbox> { |
no outgoing calls
no test coverage detected