From 42e2ea5539ae1023abb560809c0eb7cb28f63848 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Mon, 8 May 2023 15:28:41 +0200 Subject: [PATCH] Improve terminology --- src/minio.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/minio.rs b/src/minio.rs index 00b1d90..7189ac5 100644 --- a/src/minio.rs +++ b/src/minio.rs @@ -207,11 +207,11 @@ impl MinioService { .any(|b| b.bucket_name().eq(name))) } - /// Create a bucket - pub async fn create_bucket(&self, b: &MinioBucketSpec) -> anyhow::Result<()> { + /// Apply bucket desired configuration. If bucket already exists, it is not dropped + pub async fn apply_bucket(&self, b: &MinioBucketSpec) -> anyhow::Result<()> { // Set base parameters let bucket_name = format!("{}/{}", MC_ALIAS_NAME, b.name); - let mut args = ["mb", bucket_name.as_str()].to_vec(); + let mut args = ["mb", bucket_name.as_str(), "-p"].to_vec(); if b.lock { args.push("--with-lock"); @@ -441,7 +441,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -463,7 +463,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -498,7 +498,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -529,7 +529,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -582,7 +582,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -609,7 +609,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -636,7 +636,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -679,7 +679,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -724,7 +724,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -751,7 +751,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(), @@ -841,7 +841,7 @@ mod test { let srv = MinioTestServer::start().await.unwrap(); let service = srv.as_service(); service - .create_bucket(&MinioBucketSpec { + .apply_bucket(&MinioBucketSpec { instance: "".to_string(), name: TEST_BUCKET_NAME.to_string(), secret: "".to_string(),