pub struct ImageImporter { /* private fields */ }Expand description
Context for importing a container image.
Implementations§
Source§impl ImageImporter
impl ImageImporter
Sourcepub async fn new(
repo: &Repo,
imgref: &OstreeImageReference,
config: ImageProxyConfig,
) -> Result<Self>
pub async fn new( repo: &Repo, imgref: &OstreeImageReference, config: ImageProxyConfig, ) -> Result<Self>
Create a new importer.
Sourcepub fn set_target(&mut self, target: &OstreeImageReference)
pub fn set_target(&mut self, target: &OstreeImageReference)
Write cached data as if the image came from this source.
Sourcepub fn set_no_imgref(&mut self)
pub fn set_no_imgref(&mut self)
Do not write the final image ref, but do write refs for shared layers. This is useful in scenarios where you want to “pre-pull” an image, but in such a way that it does not need to be manually removed later.
Sourcepub fn require_bootable(&mut self)
pub fn require_bootable(&mut self)
Require that the image has the bootable metadata field
Sourcepub fn set_ostree_version(&mut self, year: u32, v: u32)
pub fn set_ostree_version(&mut self, year: u32, v: u32)
Override the ostree version being targeted
Sourcepub fn disable_gc(&mut self)
pub fn disable_gc(&mut self)
Do not prune image layers.
Sourcepub async fn prepare(&mut self) -> Result<PrepareResult>
pub async fn prepare(&mut self) -> Result<PrepareResult>
Determine if there is a new manifest, and if so return its digest.
This will also serialize the new manifest and configuration into
metadata associated with the image, so that invocations of [query_cached]
can re-fetch it without accessing the network.
Sourcepub fn request_progress(&mut self) -> Receiver<ImportProgress>
pub fn request_progress(&mut self) -> Receiver<ImportProgress>
Create a channel receiver that will get notifications for layer fetches.
Sourcepub fn request_layer_progress(&mut self) -> Receiver<Option<LayerProgress>>
pub fn request_layer_progress(&mut self) -> Receiver<Option<LayerProgress>>
Create a channel receiver that will get notifications for byte-level progress of layer fetches.
Sourcepub async fn unencapsulate(self) -> Result<Import>
pub async fn unencapsulate(self) -> Result<Import>
Retrieve an inner ostree commit.
This does not write cached references for each blob, and errors out if the image has any non-ostree layers.
Sourcepub async fn import(
self,
import: Box<PreparedImport>,
) -> Result<Box<LayeredImageState>>
pub async fn import( self, import: Box<PreparedImport>, ) -> Result<Box<LayeredImageState>>
Import a layered container image.
If enabled, this will also prune unused container image layers.