Skip to content

Commit

Permalink
Handle multiple cleanup policies
Browse files Browse the repository at this point in the history
cleanup.policy can be a comma-separated list https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy
  • Loading branch information
SoMuchForSubtlety committed Jun 22, 2023
1 parent 1f18edc commit 6afa8a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/kaf/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ var describeTopicCmd = &cobra.Command{

var compacted bool
for _, e := range cfg {
if e.Name == "cleanup.policy" && e.Value == "compact" {
compacted = true
if e.Name == "cleanup.policy" {
for _, setting := range strings.Split(e.Value, ",") {
if setting == "compact" {
compacted = true
}
}
}
}

Expand Down

0 comments on commit 6afa8a7

Please sign in to comment.