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

Function new_importer_with_config

crates/lib/src/deploy.rs:157–171  ·  view source on GitHub ↗

Wrapper for pulling a container image with a custom proxy config (e.g. for unified storage).

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

Source from the content-addressed store, hash-verified

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(
158 repo: &ostree::Repo,
159 imgref: &ostree_container::OstreeImageReference,
160 config: ostree_ext::containers_image_proxy::ImageProxyConfig,
161 booted_deployment: Option<&ostree::Deployment>,
162) -> Result<ostree_container::store::ImageImporter> {
163 let mut imp = ostree_container::store::ImageImporter::new(repo, imgref, config).await?;
164 imp.require_bootable();
165 // We do our own GC/prune in deploy::prune(), so skip the importer's internal one.
166 imp.disable_gc();
167 if let Some(deployment) = booted_deployment {
168 imp.set_sepolicy_commit(deployment.csum().to_string());
169 }
170 Ok(imp)
171}
172
173pub(crate) fn check_bootc_label(config: &ostree_ext::oci_spec::image::ImageConfiguration) {
174 if let Some(label) =

Callers 1

prepare_for_pull_unifiedFunction · 0.85

Calls 3

require_bootableMethod · 0.80
disable_gcMethod · 0.80
set_sepolicy_commitMethod · 0.80

Tested by

no test coverage detected