Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group.go: sort topics before printing #305

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
group.go: sort topics before printing
  • Loading branch information
m-wild committed Feb 18, 2024
commit 16f42ecaadc6f926e36e9bb3a8cfa02f433ed77c
9 changes: 8 additions & 1 deletion cmd/kaf/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,14 @@ var groupDescribeCmd = &cobra.Command{
errorExit("Failed to fetch group offsets: %v\n", err)
}

for topic, partitions := range offsetAndMetadata.Blocks {
topics := make([]string, 0, len(offsetAndMetadata.Blocks))
for k := range offsetAndMetadata.Blocks {
topics = append(topics, k)
}
sort.Strings(topics)

for _, topic := range topics {
partitions := offsetAndMetadata.Blocks[topic]
if len(flagDescribeTopics) > 0 {
var found bool
for _, topicToShow := range flagDescribeTopics {
Expand Down
Loading