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

Function sandbox_from_object

crates/openshell-driver-kubernetes/src/driver.rs:882–899  ·  view source on GitHub ↗
(namespace: &str, obj: DynamicObject)

Source from the content-addressed store, hash-verified

880}
881
882fn sandbox_from_object(namespace: &str, obj: DynamicObject) -> Result<Sandbox, String> {
883 let id = sandbox_id_from_object(&obj)?;
884 let name = obj.metadata.name.clone().unwrap_or_default();
885 let namespace = obj
886 .metadata
887 .namespace
888 .clone()
889 .unwrap_or_else(|| namespace.to_string());
890 let status = status_from_object(&obj);
891
892 Ok(Sandbox {
893 id,
894 name,
895 namespace,
896 spec: None,
897 status,
898 })
899}
900
901fn update_indexes(
902 sandbox_name_to_id: &mut std::collections::HashMap<String, String>,

Callers 2

get_sandboxMethod · 0.85
list_sandboxesMethod · 0.85

Calls 2

sandbox_id_from_objectFunction · 0.85
status_from_objectFunction · 0.85

Tested by

no test coverage detected