Skip to content

Commit

Permalink
Fix bug in kafkactl get topics that caused wrong partition IDs in J…
Browse files Browse the repository at this point in the history
…SON output
  • Loading branch information
fgrosse committed Jul 20, 2023
1 parent 5220df9 commit 6dd5345
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Fix bug in `kafkactl get topics` that caused wrong partition IDs in JSON output
- Add `--with-config` flag to `kafkactl create topic`

## [v1.2.0] - 2023-04-30
Expand Down
4 changes: 2 additions & 2 deletions cmd/get/get_topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ func (cmd *command) fetchPartitionsOffsets(client sarama.Client, topicName strin
wg.Add(1)
go func(partition *sarama.PartitionMetadata) {
defer wg.Done()
meta, err := cmd.fetchPartitionsOffset(client, topicName, p)
meta, err := cmd.fetchPartitionsOffset(client, topicName, partition)
if err != nil {
cmd.logger.Printf("ERROR: Failed to fetch offset for topic %q partition %d: %v", topicName, p.ID, err)
cmd.logger.Printf("ERROR: Failed to fetch offset for topic %q partition %d: %v", topicName, partition.ID, err)
return
}

Expand Down

0 comments on commit 6dd5345

Please sign in to comment.