From 3f545b2d06154ba80d22b22a3acdae0edf1a4c15 Mon Sep 17 00:00:00 2001 From: Niel Drummond Date: Tue, 7 Nov 2023 17:38:57 +0000 Subject: [PATCH 1/2] Add all filter to fix prune behaviour in docker 23 --- tests/volume_test.rs | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/tests/volume_test.rs b/tests/volume_test.rs index a88c7996..2e83a7b4 100644 --- a/tests/volume_test.rs +++ b/tests/volume_test.rs @@ -99,6 +99,9 @@ async fn prune_volumes_test(docker: Docker) -> Result<(), Error> { // -- let mut prune_volumes_filters = HashMap::new(); + if cfg!(not(windows)) { + prune_volumes_filters.insert("all", vec!["true"]); + } prune_volumes_filters.insert("label!", vec!["maintainer=bollard-maintainer"]); let prune_volumes_options = PruneVolumesOptions { @@ -150,27 +153,8 @@ async fn prune_volumes_test(docker: Docker) -> Result<(), Error> { let results = &docker.list_volumes::(None).await?; - let mut expected_results_label = HashMap::new(); - expected_results_label.insert( - String::from("maintainer"), - String::from("bollard-maintainer"), - ); - assert_ne!(0, results.volumes.as_ref().unwrap().len()); - // we need to filter the results, because volumes without a label are not pruned - assert_eq!( - &expected_results_label, - &results - .volumes - .as_ref() - .unwrap() - .iter() - .find(|v| !v.labels.is_empty()) - .unwrap() - .labels - ); - let remove_volume_options = RemoveVolumeOptions { force: true }; let _ = &docker .remove_volume( From c9a98cdb9af2c0ae85413bdcdbcf3558022c6226 Mon Sep 17 00:00:00 2001 From: Niel Drummond Date: Tue, 7 Nov 2023 20:17:58 +0000 Subject: [PATCH 2/2] Fix buildkit test, check image name correctly --- tests/image_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/image_test.rs b/tests/image_test.rs index 3749ed1b..113e8262 100644 --- a/tests/image_test.rs +++ b/tests/image_test.rs @@ -447,7 +447,7 @@ ENTRYPOINT ls buildkit-bollard.txt } }) .any(|status| status.id - == "naming to docker.io/library/integration_test_build_buildkit_image")); + == "naming to docker.io/library/integration_test_build_buildkit_image:latest")); let _ = &docker .create_container(