(
storage: &Storage,
host: &Host,
source: Option<&str>,
target: Option<&str>,
)
| 236 | /// Implementation of `bootc image push-to-storage`. |
| 237 | #[context("Pushing image")] |
| 238 | pub(crate) async fn push_entrypoint( |
| 239 | storage: &Storage, |
| 240 | host: &Host, |
| 241 | source: Option<&str>, |
| 242 | target: Option<&str>, |
| 243 | ) -> Result<()> { |
| 244 | let (source, target) = get_imgrefs_for_copy(host, source, target).await?; |
| 245 | |
| 246 | let ostree = storage.get_ostree()?; |
| 247 | let repo = &ostree.repo(); |
| 248 | |
| 249 | let mut opts = ostree_ext::container::store::ExportToOCIOpts::default(); |
| 250 | opts.progress_to_stdout = true; |
| 251 | println!("Copying local image {source} to {target} ..."); |
| 252 | let r = ostree_ext::container::store::export(repo, &source, &target, Some(opts)).await?; |
| 253 | |
| 254 | println!("Pushed: {target} {r}"); |
| 255 | Ok(()) |
| 256 | } |
| 257 | |
| 258 | /// Thin wrapper for invoking `podman image <X>` but set up for our internal |
| 259 | /// image store (as distinct from /var/lib/containers default). |
no test coverage detected