ahmarsuhail commented on code in PR #6482:
URL: https://github.com/apache/hadoop/pull/6482#discussion_r1461990948


##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/DefaultS3ClientFactory.java:
##########
@@ -291,15 +291,25 @@ private <BuilderT extends S3BaseClientBuilder<BuilderT, 
ClientT>, ClientT> void
     if (endpoint != null) {
       checkArgument(!fipsEnabled,
           "%s : %s", ERROR_ENDPOINT_WITH_FIPS, endpoint);
-      builder.endpointOverride(endpoint);
-      // No region was configured, try to determine it from the endpoint.
-      if (region == null) {
-        region = getS3RegionFromEndpoint(parameters.getEndpoint());
-        if (region != null) {
-          origin = "endpoint";
+      if(parameters.getEndpoint().equals(CENTRAL_ENDPOINT)){

Review Comment:
   if someone configures `fs.s3a.endpoint` to `s3.amazonaws.com` and sets 
region in `fs.s3a.endpoint.region` to `eu-west-1`, this code will start 
ignoring what we have in `fs.s3a.endpoint.region` and just enable cross region 
for everything. I think this could be risky as people could just have 
`s.s3a.endpoint` to `s3.amazonaws.com` in their core-site.xml as it doesn't 
make a difference if you've set your region right.  



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to