Skip to content

Commit

Permalink
kfake: forbid 0-partition topic creations
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Jul 27, 2023
1 parent 22fabf6 commit de7f4e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kfake/19_create_topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ topics:
donet(rt.Topic, kerr.InvalidReplicationFactor.Code)
continue
}
if rt.NumPartitions == 0 {
donet(rt.Topic, kerr.InvalidPartitions.Code)
continue
}
configs := make(map[string]*string)
for _, c := range rt.Configs {
if ok := validateSetTopicConfig(c.Name, c.Value); !ok {
Expand Down

0 comments on commit de7f4e4

Please sign in to comment.