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

Function platform_config_string

crates/openshell-driver-kubernetes/src/driver.rs:2092–2099  ·  view source on GitHub ↗

Extract a string value from the template's `platform_config` Struct.

(template: &SandboxTemplate, key: &str)

Source from the content-addressed store, hash-verified

2090
2091/// Extract a string value from the template's `platform_config` Struct.
2092fn platform_config_string(template: &SandboxTemplate, key: &str) -> Option<String> {
2093 let config = template.platform_config.as_ref()?;
2094 let value = config.fields.get(key)?;
2095 match value.kind.as_ref() {
2096 Some(prost_types::value::Kind::StringValue(s)) if !s.is_empty() => Some(s.clone()),
2097 _ => None,
2098 }
2099}
2100
2101fn platform_config_bool(template: &SandboxTemplate, key: &str) -> Option<bool> {
2102 let config = template.platform_config.as_ref()?;

Calls 2

getMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected