Skip to content

Commit 776ef9d

Browse files
[delete acls] add default value for resource pattern type (#178)
* [delete acls] add default value for resource pattern type * fix readme * fix type
1 parent ad0bc21 commit 776ef9d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The `delete` subcommand deletes a particular resource type in the cluster.
173173
Currently, the following operations are supported:
174174
| Subcommand | Description |
175175
| --------- | ----------- |
176-
| `delete acl [flags]` | Deletes a single ACL in the cluster matching the provided flags |
176+
| `delete acls [flags]` | Deletes ACL(s) in the cluster matching the provided flags |
177177

178178
#### get
179179

cmd/topicctl/subcmd/delete.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/aws/aws-sdk-go/aws/session"
88
"github.com/segmentio/kafka-go"
99
"github.com/segmentio/topicctl/pkg/acl"
10+
"github.com/segmentio/topicctl/pkg/admin"
1011
"github.com/segmentio/topicctl/pkg/cli"
1112
log "github.com/sirupsen/logrus"
1213
"github.com/spf13/cobra"
@@ -51,7 +52,11 @@ func deletePreRun(cmd *cobra.Command, args []string) error {
5152
return deleteConfig.shared.validate()
5253
}
5354

54-
var deleteACLsConfig = aclsCmdConfig{}
55+
var deleteACLsConfig = aclsCmdConfig{
56+
// This was added in a later version of Kafka, so we provide a default
57+
// value to avoid breaking existing users by making this required.
58+
resourcePatternType: admin.PatternType(kafka.PatternTypeAny),
59+
}
5560

5661
func deleteACLCmd() *cobra.Command {
5762
cmd := &cobra.Command{

0 commit comments

Comments
 (0)