Skip to content

Commit 6a30fa8

Browse files
author
Jure Zvelc
committed
Add support for RD_KAFKA_RESOURCE_TRANSACTIONAL_ID in adminapi
1 parent d0d8341 commit 6a30fa8

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

examples/docker_aws_lambda_example/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ github.com/confluentinc/confluent-kafka-go/v2 v2.4.0 h1:NbOku86JJlsRJPJKE0snNsz6
5353
github.com/confluentinc/confluent-kafka-go/v2 v2.4.0/go.mod h1:E1dEQy50ZLfqs7T9luxz0rLxaeFZJZE92XvApJOr/Rk=
5454
github.com/confluentinc/confluent-kafka-go/v2 v2.5.0/go.mod h1:Hyo+IIQ/tmsfkOcRP8T6VlSeOW3T33v0Me8Xvq4u90Y=
5555
github.com/confluentinc/confluent-kafka-go/v2 v2.5.3/go.mod h1:QxYLPRKR1MVlkXCCjzjjrpXb0VyFNfVaZXi0obZykJ0=
56+
github.com/confluentinc/confluent-kafka-go/v2 v2.8.0/go.mod h1:hScqtFIGUI1wqHIgM3mjoqEou4VweGGGX7dMpcUKves=
5657
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
5758
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
5859
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=

kafka/adminapi.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ const (
493493
ResourceUnknown ResourceType = C.RD_KAFKA_RESOURCE_UNKNOWN
494494
// ResourceAny - match any resource type (DescribeConfigs)
495495
ResourceAny ResourceType = C.RD_KAFKA_RESOURCE_ANY
496+
// ResourceTransactionalID - Transactional ID
497+
ResourceTransactionalID ResourceType = C.RD_KAFKA_RESOURCE_TRANSACTIONAL_ID
496498
// ResourceTopic - Topic
497499
ResourceTopic ResourceType = C.RD_KAFKA_RESOURCE_TOPIC
498500
// ResourceGroup - Group
@@ -512,6 +514,8 @@ func ResourceTypeFromString(typeString string) (ResourceType, error) {
512514
switch strings.ToUpper(typeString) {
513515
case "ANY":
514516
return ResourceAny, nil
517+
case "TRANSACTIONAL_ID":
518+
return ResourceTransactionalID, nil
515519
case "TOPIC":
516520
return ResourceTopic, nil
517521
case "GROUP":

kafka/integration_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,6 +2143,15 @@ func (its *IntegrationTestSuite) TestAdminACLs() {
21432143
Operation: ACLOperationRead,
21442144
PermissionType: ACLPermissionTypeAllow,
21452145
},
2146+
{
2147+
Type: ResourceTransactionalID,
2148+
Name: group,
2149+
ResourcePatternType: ResourcePatternTypePrefixed,
2150+
Principal: "User:test-user-2",
2151+
Host: "*",
2152+
Operation: ACLOperationAll,
2153+
PermissionType: ACLPermissionTypeAllow,
2154+
},
21462155
{
21472156
Type: ResourceTopic,
21482157
Name: topic,
@@ -2213,7 +2222,7 @@ func (its *IntegrationTestSuite) TestAdminACLs() {
22132222
if err != nil {
22142223
t.Fatalf("CreateACLs() failed: %s", err)
22152224
}
2216-
expectedCreateACLs = []CreateACLResult{{Error: noError}, {Error: noError}, {Error: noError}}
2225+
expectedCreateACLs = []CreateACLResult{{Error: noError}, {Error: noError}, {Error: noError}, {Error: noError}}
22172226
checkExpectedResult(expectedCreateACLs, resultCreateACLs)
22182227
}
22192228

0 commit comments

Comments
 (0)