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

Method query_image

crates/lib/src/status.rs:294–306  ·  view source on GitHub ↗

Given a boot entry, find its underlying ostree container image

(
        &self,
        repo: &ostree::Repo,
    )

Source from the content-addressed store, hash-verified

292impl BootEntry {
293 /// Given a boot entry, find its underlying ostree container image
294 pub(crate) fn query_image(
295 &self,
296 repo: &ostree::Repo,
297 ) -> Result<Option<Box<ostree_container::store::LayeredImageState>>> {
298 if self.image.is_none() {
299 return Ok(None);
300 }
301 if let Some(checksum) = self.ostree.as_ref().map(|c| c.checksum.as_str()) {
302 ostree_container::store::query_image_commit(repo, checksum).map(Some)
303 } else {
304 Ok(None)
305 }
306 }
307
308 pub(crate) fn require_composefs(&self) -> Result<&BootEntryComposefs> {
309 self.composefs.as_ref().ok_or(anyhow::anyhow!(

Callers 3

install_resetFunction · 0.80
upgradeFunction · 0.80
rollbackFunction · 0.80

Calls 2

query_image_commitFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected