Wrapper for pulling a container image, wiring up status output.
(
repo: &ostree::Repo,
imgref: &ostree_container::OstreeImageReference,
booted_deployment: Option<&ostree::Deployment>,
)
| 138 | |
| 139 | /// Wrapper for pulling a container image, wiring up status output. |
| 140 | pub(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). |
| 157 | pub(crate) async fn new_importer_with_config( |
no test coverage detected