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

Function pod_sandbox_id

crates/openshell-server/src/auth/k8s_sa.rs:392–406  ·  view source on GitHub ↗
(pod: &Pod)

Source from the content-addressed store, hash-verified

390
391#[allow(clippy::result_large_err)]
392fn pod_sandbox_id(pod: &Pod) -> Result<String, Status> {
393 let sandbox_id = pod
394 .metadata
395 .annotations
396 .as_ref()
397 .and_then(|a| a.get(SANDBOX_ID_ANNOTATION))
398 .cloned()
399 .unwrap_or_default();
400 if sandbox_id.is_empty() {
401 return Err(Status::permission_denied(
402 "pod is not bound to a sandbox identity",
403 ));
404 }
405 Ok(sandbox_id)
406}
407
408#[allow(clippy::result_large_err)]
409fn sandbox_owner_reference(pod: &Pod) -> Result<SandboxOwnerReference, Status> {

Callers 2

resolveMethod · 0.85

Calls 2

getMethod · 0.45
is_emptyMethod · 0.45

Tested by 1