(
tmpdir: &Dir,
imgref: &ostree_container::OstreeImageReference,
)
| 1520 | /// Verify that we can load the manifest of the target image |
| 1521 | #[context("Verifying fetch")] |
| 1522 | async fn verify_target_fetch( |
| 1523 | tmpdir: &Dir, |
| 1524 | imgref: &ostree_container::OstreeImageReference, |
| 1525 | ) -> Result<()> { |
| 1526 | let tmpdir = &TempDir::new_in(&tmpdir)?; |
| 1527 | let tmprepo = &ostree::Repo::create_at_dir(tmpdir.as_fd(), ".", ostree::RepoMode::Bare, None) |
| 1528 | .context("Init tmp repo")?; |
| 1529 | |
| 1530 | tracing::trace!("Verifying fetch for {imgref}"); |
| 1531 | let mut imp = |
| 1532 | ostree_container::store::ImageImporter::new(tmprepo, imgref, Default::default()).await?; |
| 1533 | use ostree_container::store::PrepareResult; |
| 1534 | let prep = match imp.prepare().await? { |
| 1535 | // SAFETY: It's impossible that the image was already fetched into this newly created temporary repository |
| 1536 | PrepareResult::AlreadyPresent(_) => unreachable!(), |
| 1537 | PrepareResult::Ready(r) => r, |
| 1538 | }; |
| 1539 | tracing::debug!("Fetched manifest with digest {}", prep.manifest_digest); |
| 1540 | Ok(()) |
| 1541 | } |
| 1542 | |
| 1543 | /// Preparation for an install; validates and prepares some (thereafter immutable) global state. |
| 1544 | async fn prepare_install( |
no test coverage detected