Skip to content

Commit 70b4617

Browse files
HDDS-1900. Remove UpdateBucket handler which supports add/remove Acl. (#1219)
1 parent ab6a5c9 commit 70b4617

File tree

5 files changed

+0
-167
lines changed

5 files changed

+0
-167
lines changed

hadoop-hdds/docs/content/shell/BucketCommands.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Ozone shell supports the following bucket commands.
2626
* [delete](#delete)
2727
* [info](#info)
2828
* [list](#list)
29-
* [update](#update)
3029

3130
### Create
3231

@@ -98,23 +97,6 @@ This command will list all buckets on the volume _hive_.
9897

9998

10099

101-
### Update
102-
103-
The bucket update command allows changing access permissions on bucket.
104-
105-
***Params:***
106-
107-
| Arguments | Comment |
108-
|--------------------------------|-----------------------------------------|
109-
| --addAcl | Optional, Comma separated ACLs that will added to bucket.
110-
| --removeAcl | Optional, Comma separated list of acl to remove.
111-
| Uri | The name of the bucket.
112-
113-
{{< highlight bash >}}
114-
ozone sh bucket update --addAcl=user:bilbo:rw /hive/jan
115-
{{< /highlight >}}
116-
117-
The above command gives user bilbo read/write permission to the bucket.
118100

119101
### path
120102
The bucket command to provide ozone mapping for s3 bucket (Created via aws cli)

hadoop-ozone/dist/src/main/smoketest/basic/ozone-shell.robot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ Test ozone shell
6161
Execute ozone sh bucket create ${protocol}${server}/${volume}/bb1
6262
${result} = Execute ozone sh bucket info ${protocol}${server}/${volume}/bb1 | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .storageType'
6363
Should Be Equal ${result} DISK
64-
${result} = Execute ozone sh bucket update ${protocol}${server}/${volume}/bb1 --addAcl user:frodo:rw,group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="samwise") | .type'
65-
Should Be Equal ${result} GROUP
66-
${result} = Execute ozone sh bucket update ${protocol}${server}/${volume}/bb1 --removeAcl group:samwise:r | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '. | select(.bucketName=="bb1") | .acls | .[] | select(.name=="frodo") | .type'
67-
Should Be Equal ${result} USER
6864
${result} = Execute ozone sh bucket list ${protocol}${server}/${volume}/ | grep -Ev 'Removed|WARN|DEBUG|ERROR|INFO|TRACE' | jq -r '.[] | select(.bucketName=="bb1") | .volumeName'
6965
Should Be Equal ${result} ${volume}
7066
Run Keyword Test key handling ${protocol} ${server} ${volume}

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/ozShell/TestOzoneShell.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.apache.hadoop.hdds.tracing.StringCodec;
4444
import org.apache.hadoop.hdfs.DFSUtil;
4545
import org.apache.hadoop.ozone.MiniOzoneCluster;
46-
import org.apache.hadoop.ozone.OzoneAcl;
4746
import org.apache.hadoop.ozone.OzoneConsts;
4847
import org.apache.hadoop.ozone.client.OzoneBucket;
4948
import org.apache.hadoop.ozone.client.OzoneKey;
@@ -57,8 +56,6 @@
5756
import org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes;
5857
import org.apache.hadoop.ozone.om.helpers.ServiceInfo;
5958
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.ServicePort;
60-
import org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLIdentityType;
61-
import org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType;
6259
import org.apache.hadoop.ozone.web.ozShell.OzoneShell;
6360
import org.apache.hadoop.ozone.web.ozShell.Shell;
6461
import org.apache.hadoop.ozone.web.request.OzoneQuota;
@@ -723,51 +720,6 @@ public void testInfoBucket() throws Exception {
723720
ResultCodes.BUCKET_NOT_FOUND);
724721
}
725722

726-
@Test
727-
public void testUpdateBucket() throws Exception {
728-
LOG.info("Running testUpdateBucket");
729-
OzoneVolume vol = creatVolume();
730-
String bucketName = "bucket" + RandomStringUtils.randomNumeric(5);
731-
vol.createBucket(bucketName);
732-
OzoneBucket bucket = vol.getBucket(bucketName);
733-
int aclSize = bucket.getAcls().size();
734-
735-
String[] args = new String[] {"bucket", "update",
736-
url + "/" + vol.getName() + "/" + bucketName, "--addAcl",
737-
"user:frodo:rw,group:samwise:r"};
738-
execute(shell, args);
739-
String output = out.toString();
740-
assertTrue(output.contains("createdOn")
741-
&& output.contains(OzoneConsts.OZONE_TIME_ZONE));
742-
743-
bucket = vol.getBucket(bucketName);
744-
assertEquals(2 + aclSize, bucket.getAcls().size());
745-
746-
OzoneAcl acl = bucket.getAcls().get(aclSize);
747-
assertTrue(acl.getName().equals("frodo")
748-
&& acl.getType() == ACLIdentityType.USER
749-
&& acl.getAclBitSet().get(ACLType.READ.ordinal())
750-
&& acl.getAclBitSet().get(ACLType.WRITE.ordinal()));
751-
752-
args = new String[] {"bucket", "update",
753-
url + "/" + vol.getName() + "/" + bucketName, "--removeAcl",
754-
"user:frodo:rw"};
755-
execute(shell, args);
756-
757-
bucket = vol.getBucket(bucketName);
758-
acl = bucket.getAcls().get(aclSize);
759-
assertEquals(1 + aclSize, bucket.getAcls().size());
760-
assertTrue(acl.getName().equals("samwise")
761-
&& acl.getType() == ACLIdentityType.GROUP
762-
&& acl.getAclBitSet().get(ACLType.READ.ordinal()));
763-
764-
// test update bucket for a non-exist bucket
765-
args = new String[] {"bucket", "update",
766-
url + "/" + vol.getName() + "/invalid-bucket", "--addAcl",
767-
"user:frodo:rw"};
768-
executeWithError(shell, args, BUCKET_NOT_FOUND);
769-
}
770-
771723
@Test
772724
public void testListBucket() throws Exception {
773725
LOG.info("Running testListBucket");

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/BucketCommands.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
InfoBucketHandler.class,
3939
ListBucketHandler.class,
4040
CreateBucketHandler.class,
41-
UpdateBucketHandler.class,
4241
DeleteBucketHandler.class,
4342
AddAclBucketHandler.class,
4443
RemoveAclBucketHandler.class,

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/UpdateBucketHandler.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)