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

Function new_importer

crates/lib/src/deploy.rs:140–154  ·  view source on GitHub ↗

Wrapper for pulling a container image, wiring up status output.

(
    repo: &ostree::Repo,
    imgref: &ostree_container::OstreeImageReference,
    booted_deployment: Option<&ostree::Deployment>,
)

Source from the content-addressed store, hash-verified

138
139/// Wrapper for pulling a container image, wiring up status output.
140pub(crate) async fn new_importer(
141 repo: &ostree::Repo,
142 imgref: &ostree_container::OstreeImageReference,
143 booted_deployment: Option<&ostree::Deployment>,
144) -> Result<ostree_container::store::ImageImporter> {
145 let config = new_proxy_config();
146 let mut imp = ostree_container::store::ImageImporter::new(repo, imgref, config).await?;
147 imp.require_bootable();
148 // We do our own GC/prune in deploy::prune(), so skip the importer's internal one.
149 imp.disable_gc();
150 if let Some(deployment) = booted_deployment {
151 imp.set_sepolicy_commit(deployment.csum().to_string());
152 }
153 Ok(imp)
154}
155
156/// Wrapper for pulling a container image with a custom proxy config (e.g. for unified storage).
157pub(crate) async fn new_importer_with_config(

Callers 2

upgradeFunction · 0.85
prepare_for_pullFunction · 0.85

Calls 4

new_proxy_configFunction · 0.85
require_bootableMethod · 0.80
disable_gcMethod · 0.80
set_sepolicy_commitMethod · 0.80

Tested by

no test coverage detected