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

Function sandbox_requested_extension

crates/openshell-driver-vm/src/lifecycle.rs:661–669  ·  view source on GitHub ↗

Returns true when `sandbox` opted into the extension identified by `key` via a policy-stamped `{SANDBOX_EXTENSION_LABEL_PREFIX}{key}` template label set to an enabled value.

(sandbox: &Sandbox, key: &str)

Source from the content-addressed store, hash-verified

659/// `key` via a policy-stamped `{SANDBOX_EXTENSION_LABEL_PREFIX}{key}`
660/// template label set to an enabled value.
661fn sandbox_requested_extension(sandbox: &Sandbox, key: &str) -> bool {
662 let label_key = format!("{SANDBOX_EXTENSION_LABEL_PREFIX}{key}");
663 sandbox
664 .spec
665 .as_ref()
666 .and_then(|spec| spec.template.as_ref())
667 .and_then(|template| template.labels.get(&label_key))
668 .is_some_and(|value| extension_label_enabled(value))
669}
670
671/// Interpret an extension request-label value. Accepts the explicit
672/// `enabled`/`requested` spellings as well as the common bool-like values

Callers 1

active_forMethod · 0.85

Calls 2

extension_label_enabledFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected