From 669776a0d74ad1b91d14a819fb650548a8092816 Mon Sep 17 00:00:00 2001 From: Peter Dannemann Date: Mon, 12 Feb 2024 13:10:51 -0500 Subject: [PATCH 1/3] [delete acls] add default value for resource pattern type --- cmd/topicctl/subcmd/delete.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/topicctl/subcmd/delete.go b/cmd/topicctl/subcmd/delete.go index 91f6345d..1d4ef65a 100644 --- a/cmd/topicctl/subcmd/delete.go +++ b/cmd/topicctl/subcmd/delete.go @@ -51,7 +51,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: kafka.PatternTypeAny, +} func deleteACLCmd() *cobra.Command { cmd := &cobra.Command{ From 94ea31b9c178dc2873b8447324619072f366cdea Mon Sep 17 00:00:00 2001 From: Peter Dannemann Date: Mon, 12 Feb 2024 13:26:03 -0500 Subject: [PATCH 2/3] fix readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99da4f73..75db8444 100644 --- a/README.md +++ b/README.md @@ -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 From 66b987c172c28275e5d7e7275312d801aaa5069c Mon Sep 17 00:00:00 2001 From: Peter Dannemann Date: Mon, 12 Feb 2024 13:29:22 -0500 Subject: [PATCH 3/3] fix type --- cmd/topicctl/subcmd/delete.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/topicctl/subcmd/delete.go b/cmd/topicctl/subcmd/delete.go index 1d4ef65a..27fdbd09 100644 --- a/cmd/topicctl/subcmd/delete.go +++ b/cmd/topicctl/subcmd/delete.go @@ -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" @@ -54,7 +55,7 @@ func deletePreRun(cmd *cobra.Command, args []string) error { 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: kafka.PatternTypeAny, + resourcePatternType: admin.PatternType(kafka.PatternTypeAny), } func deleteACLCmd() *cobra.Command {