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

Function pull_images_impl

crates/lib/src/boundimage.rs:177–202  ·  view source on GitHub ↗
(
    imgstore: &CStorage,
    bound_images: Vec<crate::boundimage::BoundImage>,
)

Source from the content-addressed store, hash-verified

175
176#[context("Pulling bound images")]
177pub(crate) async fn pull_images_impl(
178 imgstore: &CStorage,
179 bound_images: Vec<crate::boundimage::BoundImage>,
180) -> Result<()> {
181 let n = bound_images.len();
182 tracing::debug!("Pulling bound images: {n}");
183 // TODO: do this in parallel
184 for bound_image in bound_images {
185 let image = &bound_image.image;
186 if imgstore.exists(image).await? {
187 tracing::debug!("Bound image already present: {image}");
188 continue;
189 }
190 let desc = format!("Fetching bound image: {image}");
191 crate::utils::async_task_with_spinner(&desc, async move {
192 imgstore
193 .pull(&bound_image.image, PullMode::IfNotExists)
194 .await
195 })
196 .await?;
197 }
198
199 println!("Bound images stored: {n}");
200
201 Ok(())
202}
203
204impl BoundImage {
205 fn new(image: String, auth_file: Option<String>) -> Result<BoundImage> {

Callers 3

install_with_sysrootFunction · 0.85
pull_imagesFunction · 0.85
impl_completionFunction · 0.85

Calls 3

existsMethod · 0.80
pullMethod · 0.80
async_task_with_spinnerFunction · 0.70

Tested by

no test coverage detected