Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Jinli Liang <[email protected]>
  • Loading branch information
PaulLiang1 committed Jan 11, 2022
1 parent 41d7ad2 commit f8b6735
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 @@ -309,6 +309,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 f8b6735

Please sign in to comment.