Skip to content

Commit

Permalink
MINOR: Add missing Alter Operation to Topic supported operations list…
Browse files Browse the repository at this point in the history
… in AclCommand

- Update the AclCommandTest

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

Reviewers: Jun Rao <junrao@gmail.com>

Closes #6263 from omkreddy/aclcommand
  • Loading branch information
omkreddy committed Jun 22, 2019
1 parent a297722 commit 72c74e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/admin/AclCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
10 changes: 5 additions & 5 deletions core/src/test/scala/unit/kafka/admin/AclCommandTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
)
Expand Down

0 comments on commit 72c74e0

Please sign in to comment.