Skip to content

Commit

Permalink
fix(object_store): pass user-supplied configurations to with_minio (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel authored Jan 22, 2024
1 parent b4f9b48 commit 3b8c942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/object_store/src/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down
7 changes: 5 additions & 2 deletions src/object_store/src/object/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ObjectStoreMetrics>) -> Self {
pub async fn with_minio(
server: &str,
metrics: Arc<ObjectStoreMetrics>,
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();
Expand All @@ -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),
Expand Down

0 comments on commit 3b8c942

Please sign in to comment.