Damans227 commented on code in PR #12426:
URL: https://github.com/apache/cloudstack/pull/12426#discussion_r2699309890


##########
utils/src/main/java/com/cloud/utils/storage/S3/S3Utils.java:
##########
@@ -114,6 +114,8 @@ public static TransferManager getTransferManager(final 
ClientOptions clientOptio
             LOGGER.debug(format("Setting the end point for S3 client with 
access key %1$s to %2$s.", clientOptions.getAccessKey(), 
clientOptions.getEndPoint()));
 
             client.setEndpoint(clientOptions.getEndPoint());
+            // Enable path-style access for S3-compatible storage
+            
client.setS3ClientOptions(com.amazonaws.services.s3.S3ClientOptions.builder().setPathStyleAccess(true).build());

Review Comment:
   hmm, path-style access code is already inside the `if 
(StringUtils.isNotBlank(clientOptions.getEndPoint()))` block - which means 
path-style access is only enabled when a custom endpoint is specified. The code 
is already does what Copilot is asking for.



##########
utils/src/main/java/com/cloud/utils/storage/S3/S3Utils.java:
##########
@@ -114,6 +114,8 @@ public static TransferManager getTransferManager(final 
ClientOptions clientOptio
             LOGGER.debug(format("Setting the end point for S3 client with 
access key %1$s to %2$s.", clientOptions.getAccessKey(), 
clientOptions.getEndPoint()));
 
             client.setEndpoint(clientOptions.getEndPoint());
+            // Enable path-style access for S3-compatible storage
+            
client.setS3ClientOptions(com.amazonaws.services.s3.S3ClientOptions.builder().setPathStyleAccess(true).build());

Review Comment:
   hmm, path-style access code is already inside the `if 
(StringUtils.isNotBlank(clientOptions.getEndPoint()))` block - which means 
path-style access is only enabled when a custom endpoint is specified. The code 
is already doing what Copilot is asking for.



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

Reply via email to