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

Function get_image_origin

crates/lib/src/status.rs:175–181  ·  view source on GitHub ↗

Parse an ostree origin file (a keyfile) and extract the targeted container image reference.

(origin: &glib::KeyFile)

Source from the content-addressed store, hash-verified

173/// Parse an ostree origin file (a keyfile) and extract the targeted
174/// container image reference.
175fn get_image_origin(origin: &glib::KeyFile) -> Result<Option<OstreeImageReference>> {
176 origin
177 .optional_string("origin", ostree_container::deploy::ORIGIN_CONTAINER)
178 .context("Failed to load container image from origin")?
179 .map(|v| ostree_container::OstreeImageReference::try_from(v.as_str()))
180 .transpose()
181}
182
183pub(crate) struct Deployments {
184 pub(crate) staged: Option<ostree::Deployment>,

Callers 1

Calls 1

optional_stringMethod · 0.80

Tested by

no test coverage detected