From 3b8c9423e92332731488351015e2031d78246198 Mon Sep 17 00:00:00 2001 From: Noel Kwan <47273164+kwannoel@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:05:33 +0800 Subject: [PATCH] fix(object_store): pass user-supplied configurations to `with_minio` (#14723) --- src/object_store/src/object/mod.rs | 2 +- src/object_store/src/object/s3.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/object_store/src/object/mod.rs b/src/object_store/src/object/mod.rs index cfb3d3d699b4..ab5abe0d0747 100644 --- a/src/object_store/src/object/mod.rs +++ b/src/object_store/src/object/mod.rs @@ -876,7 +876,7 @@ pub async fn build_remote_object_store( panic!("Passing s3-compatible is not supported, please modify the environment variable and pass in s3."); } minio if minio.starts_with("minio://") => ObjectStoreImpl::S3( - S3ObjectStore::with_minio(minio, metrics.clone()) + S3ObjectStore::with_minio(minio, metrics.clone(), config) .await .monitored(metrics), ), diff --git a/src/object_store/src/object/s3.rs b/src/object_store/src/object/s3.rs index 7bff2292a1c7..cddb9c0c75e3 100644 --- a/src/object_store/src/object/s3.rs +++ b/src/object_store/src/object/s3.rs @@ -630,7 +630,11 @@ impl S3ObjectStore { } /// Creates a minio client. The server should be like `minio://key:secret@address:port/bucket`. - pub async fn with_minio(server: &str, metrics: Arc) -> Self { + pub async fn with_minio( + server: &str, + metrics: Arc, + s3_object_store_config: ObjectStoreConfig, + ) -> Self { let server = server.strip_prefix("minio://").unwrap(); let (access_key_id, rest) = server.split_once(':').unwrap(); let (secret_access_key, mut rest) = rest.split_once('@').unwrap(); @@ -645,7 +649,6 @@ impl S3ObjectStore { }; let (address, bucket) = rest.split_once('/').unwrap(); - let s3_object_store_config = ObjectStoreConfig::default(); #[cfg(madsim)] let builder = aws_sdk_s3::config::Builder::new().credentials_provider( Credentials::from_keys(access_key_id, secret_access_key, None),