From 8b97c3d8a96424e09f5e9ba1846625dfeb419923 Mon Sep 17 00:00:00 2001 From: Manikumar Reddy Date: Thu, 14 Feb 2019 09:45:09 +0530 Subject: [PATCH] MINOR: Add missing Alter Operation to Topic supported operations list in AclCommand - Update the AclCommandTest Author: Manikumar Reddy Reviewers: Jun Rao Closes #6263 from omkreddy/aclcommand --- core/src/main/scala/kafka/admin/AclCommand.scala | 2 +- .../test/scala/unit/kafka/admin/AclCommandTest.scala | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/main/scala/kafka/admin/AclCommand.scala b/core/src/main/scala/kafka/admin/AclCommand.scala index 397238aed39..51177b2ead0 100644 --- a/core/src/main/scala/kafka/admin/AclCommand.scala +++ b/core/src/main/scala/kafka/admin/AclCommand.scala @@ -42,7 +42,7 @@ object AclCommand extends Logging { private val Newline = scala.util.Properties.lineSeparator val ResourceTypeToValidOperations: Map[JResourceType, Set[Operation]] = Map[JResourceType, Set[Operation]]( - JResourceType.TOPIC -> Set(Read, Write, Create, Describe, Delete, DescribeConfigs, AlterConfigs, All), + JResourceType.TOPIC -> Set(Read, Write, Create, Describe, Delete, Alter, DescribeConfigs, AlterConfigs, All), JResourceType.GROUP -> Set(Read, Describe, Delete, All), JResourceType.CLUSTER -> Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite, Alter, Describe, All), JResourceType.TRANSACTIONAL_ID -> Set(Describe, Write, All), diff --git a/core/src/test/scala/unit/kafka/admin/AclCommandTest.scala b/core/src/test/scala/unit/kafka/admin/AclCommandTest.scala index d5535a50ab1..7d7b8e49256 100644 --- a/core/src/test/scala/unit/kafka/admin/AclCommandTest.scala +++ b/core/src/test/scala/unit/kafka/admin/AclCommandTest.scala @@ -56,13 +56,13 @@ class AclCommandTest extends ZooKeeperTestHarness with Logging { ) private val ResourceToOperations = Map[Set[Resource], (Set[Operation], Array[String])]( - TopicResources -> (Set(Read, Write, Create, Describe, Delete, DescribeConfigs, AlterConfigs), + TopicResources -> (Set(Read, Write, Create, Describe, Delete, DescribeConfigs, AlterConfigs, Alter), Array("--operation", "Read" , "--operation", "Write", "--operation", "Create", "--operation", "Describe", "--operation", "Delete", - "--operation", "DescribeConfigs", "--operation", "AlterConfigs")), - Set(Resource.ClusterResource) -> (Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite), + "--operation", "DescribeConfigs", "--operation", "AlterConfigs", "--operation", "Alter")), + Set(Resource.ClusterResource) -> (Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite, Alter, Describe), Array("--operation", "Create", "--operation", "ClusterAction", "--operation", "DescribeConfigs", - "--operation", "AlterConfigs", "--operation", "IdempotentWrite")), - GroupResources -> (Set(Read, Describe), Array("--operation", "Read", "--operation", "Describe")), + "--operation", "AlterConfigs", "--operation", "IdempotentWrite", "--operation", "Alter", "--operation", "Describe")), + GroupResources -> (Set(Read, Describe, Delete), Array("--operation", "Read", "--operation", "Describe", "--operation", "Delete")), TransactionalIdResources -> (Set(Describe, Write), Array("--operation", "Describe", "--operation", "Write")), TokenResources -> (Set(Describe), Array("--operation", "Describe")) )