MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / podman_driver_config

Function podman_driver_config

crates/openshell-driver-podman/src/container.rs:628–640  ·  view source on GitHub ↗
(
    template: &DriverSandboxTemplate,
    enable_bind_mounts: bool,
)

Source from the content-addressed store, hash-verified

626}
627
628fn 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
642fn validate_podman_driver_mounts(
643 mounts: &[PodmanDriverMountConfig],

Callers 3

podman_user_mountsFunction · 0.85

Calls 2

struct_to_json_objectFunction · 0.85

Tested by

no test coverage detected