(
template: &DriverSandboxTemplate,
enable_bind_mounts: bool,
)
| 626 | } |
| 627 | |
| 628 | fn podman_driver_config( |
| 629 | template: &DriverSandboxTemplate, |
| 630 | enable_bind_mounts: bool, |
| 631 | ) -> Result<PodmanSandboxDriverConfig, String> { |
| 632 | let Some(config) = template.driver_config.as_ref() else { |
| 633 | return Ok(PodmanSandboxDriverConfig::default()); |
| 634 | }; |
| 635 | let json = Value::Object(proto_struct::struct_to_json_object(config)); |
| 636 | let config: PodmanSandboxDriverConfig = serde_json::from_value(json) |
| 637 | .map_err(|err| format!("invalid podman driver_config: {err}"))?; |
| 638 | validate_podman_driver_mounts(&config.mounts, enable_bind_mounts)?; |
| 639 | Ok(config) |
| 640 | } |
| 641 | |
| 642 | fn validate_podman_driver_mounts( |
| 643 | mounts: &[PodmanDriverMountConfig], |
no test coverage detected