Copilot commented on code in PR #11115:
URL: https://github.com/apache/cloudstack/pull/11115#discussion_r2179242291
##########
plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java:
##########
@@ -193,19 +193,19 @@ public void setBucketPolicy(BucketTO bucket, String
policy, long storeId) {
policyConfig = "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
}
- AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getAccessKey());
+ AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getSecretKey());
client.setBucketPolicy(new SetBucketPolicyRequest(bucket.getName(),
policyConfig));
}
@Override
public BucketPolicy getBucketPolicy(BucketTO bucket, long storeId) {
- AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getAccessKey());
+ AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getSecretKey());
return client.getBucketPolicy(new
GetBucketPolicyRequest(bucket.getName()));
}
@Override
public void deleteBucketPolicy(BucketTO bucket, long storeId) {
- AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getAccessKey());
+ AmazonS3 client = getS3Client(getStoreURL(storeId),
bucket.getAccessKey(), bucket.getSecretKey());
Review Comment:
[nitpick] Consider extracting the repeated `getS3Client` initialization into
a private helper method to reduce duplication and improve readability across
bucket operations.
--
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]