Skip to content

Commit adf0124

Browse files
committed
More parking
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
1 parent f1cf754 commit adf0124

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/blobstore-s3/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ pub struct S3BlobStoreRuntimeConfig {
3131
token: Option<String>,
3232
/// The AWS region where the S3 account is located
3333
region: String,
34-
container_name: Option<String>,
34+
/// The name of the bucket backing the store. The default is the store label.
35+
bucket: Option<String>,
3536
}
3637

3738
impl MakeBlobStore for S3BlobStore {
@@ -51,7 +52,7 @@ impl MakeBlobStore for S3BlobStore {
5152
_ => anyhow::bail!("either both of access_key and secret_key must be provided, or neither"),
5253
};
5354

54-
let blob_store = BlobStoreS3::new(runtime_config.region, auth, runtime_config.container_name)?;
55+
let blob_store = BlobStoreS3::new(runtime_config.region, auth, runtime_config.bucket)?;
5556
Ok(blob_store)
5657
}
5758
}

crates/blobstore-s3/src/store.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct BlobStoreS3 {
1616
aws_sdk_s3::Client,
1717
std::pin::Pin<Box<dyn std::future::Future<Output = aws_sdk_s3::Client> + Send>>,
1818
>,
19-
container_name: Option<String>,
19+
bucket: Option<String>,
2020
}
2121

2222
/// AWS S3 runtime config literal options for authentication
@@ -70,7 +70,7 @@ impl BlobStoreS3 {
7070
pub fn new(
7171
region: String,
7272
auth_options: BlobStoreS3AuthOptions,
73-
container_name: Option<String>,
73+
bucket: Option<String>,
7474
) -> Result<Self> {
7575
let builder = match &auth_options {
7676
BlobStoreS3AuthOptions::RuntimeConfigValues(config) =>
@@ -97,14 +97,14 @@ impl BlobStoreS3 {
9797
aws_sdk_s3::Client::new(&sdk_config)
9898
});
9999

100-
Ok(Self { builder, client: async_once_cell::Lazy::from_future(client_fut), container_name })
100+
Ok(Self { builder, client: async_once_cell::Lazy::from_future(client_fut), bucket })
101101
}
102102
}
103103

104104
#[async_trait]
105105
impl ContainerManager for BlobStoreS3 {
106106
async fn get(&self, name: &str) -> Result<Arc<dyn Container>, Error> {
107-
let name = self.container_name.clone().unwrap_or_else(|| name.to_owned());
107+
let name = self.bucket.clone().unwrap_or_else(|| name.to_owned());
108108

109109
let store = self.builder.clone().with_bucket_name(&name).build().map_err(|e| e.to_string())?;
110110

0 commit comments

Comments
 (0)