(
imgstore: &CStorage,
bound_images: Vec<crate::boundimage::BoundImage>,
)
| 175 | |
| 176 | #[context("Pulling bound images")] |
| 177 | pub(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 | |
| 204 | impl BoundImage { |
| 205 | fn new(image: String, auth_file: Option<String>) -> Result<BoundImage> { |
no test coverage detected