Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Jinli Liang <paul.liang@rokt.com>
  • Loading branch information
PaulLiang1 committed Dec 22, 2021
1 parent 5f659f9 commit 36a3ae4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scalers/kafka_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) {
return nil, fmt.Errorf("error describing topics: %s", err)
}

if s.metadata.topic != "" && len(topicsMetadata) != 1 {
return nil, fmt.Errorf("expected only 1 topic metadata, got %d", len(topicsMetadata))
}

topicPartitions := make(map[string][]int32, len(topicsMetadata))
for _, topicMetadata := range topicsMetadata {
partitionMetadata := topicMetadata.Partitions
Expand Down

0 comments on commit 36a3ae4

Please sign in to comment.