dockertest/docker/volume.rs
1use bollard::volume::RemoveVolumeOptions;
2use futures::future::join_all;
3use tracing::{event, Level};
4
5use super::Docker;
6
7impl Docker {
8 pub async fn remove_volumes(&self, volumes: &[String]) {
9 join_all(
10 volumes
11 .iter()
12 .map(|v| {
13 event!(Level::INFO, "removing named volume: {:?}", &v);
14 let options = Some(RemoveVolumeOptions { force: true });
15 self.client.remove_volume(v, options)
16 })
17 .collect::<Vec<_>>(),
18 )
19 .await;
20 }
21}