m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-19 10:23:42 -05:00

Move usage of get_images_from_docker_daemon to get_updates

This commit is contained in:
Sergio
2024-11-16 12:38:00 +02:00
parent 6b83f51749
commit 4519c534a1
4 changed files with 10 additions and 39 deletions

View File

@@ -29,35 +29,6 @@ pub async fn get_images_from_docker_daemon(
references: &Option<Vec<String>>,
) -> Vec<Image> {
let client: Docker = create_docker_client(config.socket.clone());
// If https://github.com/moby/moby/issues/48612 is fixed, this code should be faster (if it works, it may also be entirely stupid). For now a workaround will be used.
// let mut filters = HashMap::with_capacity(1);
// match references {
// Some(refs) => {
// filters.insert("reference".to_string(), refs.clone());
// }
// None => (),
// }
// let images: Vec<ImageSummary> = match client
// .list_images::<String>(Some(ListImagesOptions {
// filters,
// ..Default::default()
// }))
// .await
// {
// Ok(images) => images,
// Err(e) => {
// error!("Failed to retrieve list of images available!\n{}", e)
// }
// };
// let mut handles = Vec::new();
// for image in images {
// handles.push(Image::from(image, options))
// }
// join_all(handles)
// .await
// .iter()
// .filter_map(|img| img.clone())
// .collect()
match references {
Some(refs) => {
let mut inspect_handles = Vec::with_capacity(refs.len());