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

Method reload_from_proto_with_pid

crates/openshell-supervisor-network/src/opa.rs:410–428  ·  view source on GitHub ↗

Reload policy from a proto with symlink resolution. When `entrypoint_pid` is non-zero, binary paths that are symlinks inside the container filesystem are resolved and added as additional match entries. See [`from_proto_with_pid`] for details.

(
        &self,
        proto: &ProtoSandboxPolicy,
        entrypoint_pid: u32,
    )

Source from the content-addressed store, hash-verified

408 /// inside the container filesystem are resolved and added as additional
409 /// match entries. See [`from_proto_with_pid`] for details.
410 pub fn reload_from_proto_with_pid(
411 &self,
412 proto: &ProtoSandboxPolicy,
413 entrypoint_pid: u32,
414 ) -> Result<()> {
415 // Build a complete new engine through the same validated pipeline.
416 let new = Self::from_proto_with_pid(proto, entrypoint_pid)?;
417 let new_engine = new
418 .engine
419 .into_inner()
420 .map_err(|_| miette::miette!("lock poisoned on new engine"))?;
421 let mut engine = self
422 .engine
423 .lock()
424 .map_err(|_| miette::miette!("OPA engine lock poisoned"))?;
425 *engine = new_engine;
426 self.generation.fetch_add(1, Ordering::AcqRel);
427 Ok(())
428 }
429
430 /// Current policy generation. Successful reloads increment this value.
431 pub fn current_generation(&self) -> u64 {

Calls

no outgoing calls