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

Function write_sandbox_image_metadata

crates/openshell-driver-vm/src/driver.rs:4408–4425  ·  view source on GitHub ↗
(
    state_dir: &Path,
    image_ref: &str,
    image_identity: &str,
)

Source from the content-addressed store, hash-verified

4406}
4407
4408async fn write_sandbox_image_metadata(
4409 state_dir: &Path,
4410 image_ref: &str,
4411 image_identity: &str,
4412) -> Result<(), std::io::Error> {
4413 tokio::fs::write(
4414 state_dir.join(IMAGE_IDENTITY_FILE),
4415 format!("{image_identity}\n"),
4416 )
4417 .await?;
4418 tokio::fs::write(
4419 state_dir.join(IMAGE_REFERENCE_FILE),
4420 format!("{image_ref}\n"),
4421 )
4422 .await?;
4423
4424 Ok(())
4425}
4426
4427async fn write_sandbox_request(state_dir: &Path, sandbox: &Sandbox) -> Result<(), std::io::Error> {
4428 restrict_owner_only_dir(state_dir).await?;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected