Browse Source

MINOR: Add missing Alter Operation to Topic supported operations list in AclCommand

- Update the AclCommandTest

Author: Manikumar Reddy <manikumar.reddy@gmail.com>

Reviewers: Jun Rao <junrao@gmail.com>

Closes #6263 from omkreddy/aclcommand
pull/6266/head
Manikumar Reddy 6 years ago committed by Manikumar Reddy
parent
commit
8b97c3d8a9
  1. 2
      core/src/main/scala/kafka/admin/AclCommand.scala
  2. 10
      core/src/test/scala/unit/kafka/admin/AclCommandTest.scala

2
core/src/main/scala/kafka/admin/AclCommand.scala

@ -42,7 +42,7 @@ object AclCommand extends Logging {
private val Newline = scala.util.Properties.lineSeparator private val Newline = scala.util.Properties.lineSeparator
val ResourceTypeToValidOperations: Map[JResourceType, Set[Operation]] = Map[JResourceType, Set[Operation]]( 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.GROUP -> Set(Read, Describe, Delete, All),
JResourceType.CLUSTER -> Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite, Alter, Describe, All), JResourceType.CLUSTER -> Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite, Alter, Describe, All),
JResourceType.TRANSACTIONAL_ID -> Set(Describe, Write, All), JResourceType.TRANSACTIONAL_ID -> Set(Describe, Write, All),

10
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])]( 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", Array("--operation", "Read" , "--operation", "Write", "--operation", "Create", "--operation", "Describe", "--operation", "Delete",
"--operation", "DescribeConfigs", "--operation", "AlterConfigs")), "--operation", "DescribeConfigs", "--operation", "AlterConfigs", "--operation", "Alter")),
Set(Resource.ClusterResource) -> (Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite), Set(Resource.ClusterResource) -> (Set(Create, ClusterAction, DescribeConfigs, AlterConfigs, IdempotentWrite, Alter, Describe),
Array("--operation", "Create", "--operation", "ClusterAction", "--operation", "DescribeConfigs", Array("--operation", "Create", "--operation", "ClusterAction", "--operation", "DescribeConfigs",
"--operation", "AlterConfigs", "--operation", "IdempotentWrite")), "--operation", "AlterConfigs", "--operation", "IdempotentWrite", "--operation", "Alter", "--operation", "Describe")),
GroupResources -> (Set(Read, Describe), Array("--operation", "Read", "--operation", "Describe")), GroupResources -> (Set(Read, Describe, Delete), Array("--operation", "Read", "--operation", "Describe", "--operation", "Delete")),
TransactionalIdResources -> (Set(Describe, Write), Array("--operation", "Describe", "--operation", "Write")), TransactionalIdResources -> (Set(Describe, Write), Array("--operation", "Describe", "--operation", "Write")),
TokenResources -> (Set(Describe), Array("--operation", "Describe")) TokenResources -> (Set(Describe), Array("--operation", "Describe"))
) )

Loading…
Cancel
Save