MCPcopy Create free account
hub / github.com/bootc-dev/bootc / deployment_origin_container

Function deployment_origin_container

crates/ostree-ext/src/container/deploy.rs:177–189  ·  view source on GitHub ↗

Query the container image reference for a deployment

(
    deploy: &ostree::Deployment,
)

Source from the content-addressed store, hash-verified

175
176/// Query the container image reference for a deployment
177fn deployment_origin_container(
178 deploy: &ostree::Deployment,
179) -> Result<Option<OstreeImageReference>> {
180 let origin = deploy
181 .origin()
182 .map(|o| o.optional_string("origin", ORIGIN_CONTAINER))
183 .transpose()?
184 .flatten();
185 let r = origin
186 .map(|v| OstreeImageReference::try_from(v.as_str()))
187 .transpose()?;
188 Ok(r)
189}
190
191/// Remove all container images which are not the target of a deployment.
192/// This acts equivalently to [`super::store::remove_images()`] - the underlying layers

Callers 1

remove_undeployed_imagesFunction · 0.85

Calls 1

optional_stringMethod · 0.80

Tested by

no test coverage detected