Skip to content

Commit

Permalink
HDDS-11737. UnsupportedOperationException in S3 setBucketAcl (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Nov 18, 2024
1 parent b252181 commit 20e4969
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@

import java.io.IOException;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

import org.apache.commons.collections.ListUtils;
import org.apache.hadoop.hdds.client.OzoneQuota;
import org.apache.hadoop.hdds.conf.ConfigurationSource;
import org.apache.hadoop.hdds.scm.client.HddsClientUtils;
Expand Down Expand Up @@ -124,7 +125,7 @@ protected OzoneVolume(Builder builder) {
this.creationTime.getEpochSecond(), this.creationTime.getNano());
}
}
this.acls = builder.acls;
this.acls = new ArrayList<>(builder.acls);
if (builder.conf != null) {
this.listCacheSize = HddsClientUtils.getListCacheSize(builder.conf);
}
Expand Down Expand Up @@ -203,7 +204,7 @@ public Instant getModificationTime() {
* @return aclMap
*/
public List<OzoneAcl> getAcls() {
return ListUtils.unmodifiableList(acls);
return Collections.unmodifiableList(acls);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void testCreateBucket() {

@Test
public void testBucketACLOperations() {
// TODO: Uncomment assertions when bucket S3 ACL logic has been fixed
// TODO HDDS-11738: Uncomment assertions when bucket S3 ACL logic has been fixed
final String bucketName = getBucketName();

AccessControlList aclList = new AccessControlList();
Expand All @@ -235,15 +235,12 @@ public void testBucketACLOperations() {

s3Client.createBucket(createBucketRequest);

// AccessControlList retrievedAclList = s3.getBucketAcl(bucketName);
// assertEquals(aclList, retrievedAclList);
//assertEquals(aclList, s3Client.getBucketAcl(bucketName));

// aclList.grantPermission(grantee, Permission.Write);
// s3.setBucketAcl(bucketName, aclList);

// retrievedAclList = s3.getBucketAcl(bucketName);
// assertEquals(aclList, retrievedAclList);
aclList.grantPermission(grantee, Permission.Write);
s3Client.setBucketAcl(bucketName, aclList);

//assertEquals(aclList, s3Client.getBucketAcl(bucketName));
}

@Test
Expand Down

0 comments on commit 20e4969

Please sign in to comment.