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

Method from_template

crates/openshell-driver-kubernetes/src/driver.rs:124–132  ·  view source on GitHub ↗
(template: &SandboxTemplate)

Source from the content-addressed store, hash-verified

122 }
123
124 fn from_template(template: &SandboxTemplate) -> Result<Self, String> {
125 let Some(config) = template.driver_config.as_ref() else {
126 return Ok(Self::default());
127 };
128
129 let json = serde_json::Value::Object(struct_to_json_object(config));
130 serde_json::from_value(json)
131 .map_err(|err| format!("invalid kubernetes driver_config: {err}"))
132 }
133}
134
135#[derive(Debug, Clone, Default, Deserialize)]

Callers

nothing calls this directly

Calls 1

struct_to_json_objectFunction · 0.85

Tested by

no test coverage detected