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

Method resolve_sandbox_uid

crates/openshell-driver-kubernetes/src/config.rs:347–361  ·  view source on GitHub ↗

Resolve the sandbox UID/GID pair. Resolution order: 1. Configured `sandbox_uid` / `sandbox_gid` (explicit override) 2. `OpenShift` SCC namespace annotations (`sa.scc.uid-range`, `sa.scc.supplemental-groups`) — passed in as the optional `namespace_annotations` map 3. Fallback defaults: UID=`1000`, GID=UID

(
        &self,
        namespace_annotations: Option<&std::collections::BTreeMap<String, String>>,
    )

Source from the content-addressed store, hash-verified

345 /// `namespace_annotations` map
346 /// 3. Fallback defaults: UID=`1000`, GID=UID
347 pub fn resolve_sandbox_uid(
348 &self,
349 namespace_annotations: Option<&std::collections::BTreeMap<String, String>>,
350 ) -> u32 {
351 if let Some(uid) = self.sandbox_uid {
352 return uid;
353 }
354 if let Some(anns) = namespace_annotations
355 && let Some(range) = anns.get(ANNOTATION_SCC_UID_RANGE)
356 && let Some(uid) = Self::from_open_shift_uid_range(range)
357 {
358 return uid;
359 }
360 DEFAULT_SANDBOX_UID
361 }
362
363 pub fn resolve_sandbox_gid(
364 &self,

Calls 1

getMethod · 0.45