pub struct ImageService { /* private fields */ }Expand description
CRI ImageService implementation.
Implementations§
Source§impl ImageService
impl ImageService
Sourcepub const DEFAULT_MAX_STORAGE: u64 = 10_737_418_240u64
pub const DEFAULT_MAX_STORAGE: u64 = 10_737_418_240u64
Default maximum image storage: 10 GB.
Sourcepub fn with_max_storage(max_storage: u64) -> Self
pub fn with_max_storage(max_storage: u64) -> Self
Create with a custom storage limit.
Sourcepub fn pull_image(
&mut self,
spec: ImageSpec,
_auth: Option<AuthConfig>,
current_tick: u64,
) -> Result<u64, ImageError>
pub fn pull_image( &mut self, spec: ImageSpec, _auth: Option<AuthConfig>, current_tick: u64, ) -> Result<u64, ImageError>
Pull an image from a registry.
In the kernel environment this is a conceptual operation that registers the image metadata. Actual layer download would go through the network stack and filesystem.
Sourcepub fn list_images(&self) -> Vec<&ImageStatus>
pub fn list_images(&self) -> Vec<&ImageStatus>
List all images.
Sourcepub fn image_status(&self, image_id: u64) -> Option<&ImageStatus>
pub fn image_status(&self, image_id: u64) -> Option<&ImageStatus>
Get image status by ID.
Sourcepub fn image_status_by_ref(&self, reference: &str) -> Option<&ImageStatus>
pub fn image_status_by_ref(&self, reference: &str) -> Option<&ImageStatus>
Get image status by reference string.
Sourcepub fn remove_image(&mut self, image_id: u64) -> Result<(), ImageError>
pub fn remove_image(&mut self, image_id: u64) -> Result<(), ImageError>
Remove an image.
Sourcepub fn remove_image_by_ref(&mut self, reference: &str) -> Result<(), ImageError>
pub fn remove_image_by_ref(&mut self, reference: &str) -> Result<(), ImageError>
Remove an image by reference string.
Sourcepub fn image_count(&self) -> usize
pub fn image_count(&self) -> usize
Get the total number of images.
Sourcepub fn used_storage(&self) -> u64
pub fn used_storage(&self) -> u64
Get total storage used.
Sourcepub fn available_storage(&self) -> u64
pub fn available_storage(&self) -> u64
Get available storage.