Skip to content

Commit

Permalink
[delete acls] add default value for resource pattern type (#178)
Browse files Browse the repository at this point in the history
* [delete acls] add default value for resource pattern type

* fix readme

* fix type
  • Loading branch information
petedannemann authored Feb 12, 2024
1 parent ad0bc21 commit 776ef9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ The `delete` subcommand deletes a particular resource type in the cluster.
Currently, the following operations are supported:
| Subcommand | Description |
| --------- | ----------- |
| `delete acl [flags]` | Deletes a single ACL in the cluster matching the provided flags |
| `delete acls [flags]` | Deletes ACL(s) in the cluster matching the provided flags |

#### get

Expand Down
7 changes: 6 additions & 1 deletion cmd/topicctl/subcmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/segmentio/kafka-go"
"github.com/segmentio/topicctl/pkg/acl"
"github.com/segmentio/topicctl/pkg/admin"
"github.com/segmentio/topicctl/pkg/cli"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -51,7 +52,11 @@ func deletePreRun(cmd *cobra.Command, args []string) error {
return deleteConfig.shared.validate()
}

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

func deleteACLCmd() *cobra.Command {
cmd := &cobra.Command{
Expand Down

0 comments on commit 776ef9d

Please sign in to comment.