Xuanwo commented on code in PR #2812:
URL:
https://github.com/apache/incubator-opendal/pull/2812#discussion_r1286727795
##########
core/src/services/s3/backend.rs:
##########
@@ -772,19 +772,9 @@ impl Builder for S3Builder {
cfg.region = Some(v);
}
if cfg.region.is_none() {
- // AWS S3 requires region to be set.
- if self.endpoint.is_none()
- || self.endpoint.as_deref() == Some("https://s3.amazonaws.com")
- {
- return Err(Error::new(ErrorKind::ConfigInvalid, "region is
missing")
- .with_operation("Builder::build")
- .with_context("service", Scheme::S3));
- }
-
- // For other compatible services, if we don't know region
- // after loading from builder and env, we can use `us-east-1`
- // as default.
- cfg.region = Some("us-east-1".to_string());
+ return Err(Error::new(ErrorKind::ConfigInvalid, "region is
missing")
Review Comment:
To encourage users to programmatically find the region, we can include a
helpful message suggesting the use of `S3::detect_region`.
For example: `region is missing. Please find it by S3::detect_region() or
set them in env.`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]