Skip to content

Commit

Permalink
Don't set nil config when seeding topics in kfake cluster
Browse files Browse the repository at this point in the history
Setting the configs to `nil` causes it to panic later when trying to alter the topic configs, as it only checks for entry in the map not being present, not for it being nil

Signed-off-by: Oleg Zaytsev <[email protected]>
  • Loading branch information
colega committed Sep 20, 2024
1 parent b77dd13 commit f1cded5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/kfake/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ func (d *data) mkt(t string, nparts int, nreplicas int, configs map[string]*stri
d.id2t[id] = t
d.t2id[t] = id
d.treplicas[t] = nreplicas
d.tcfgs[t] = configs
if configs != nil {
d.tcfgs[t] = configs
}
for i := 0; i < nparts; i++ {
d.tps.mkp(t, int32(i), d.c.newPartData)
}
Expand Down

0 comments on commit f1cded5

Please sign in to comment.