From f1cded5cc755374d6cac290c23da247ce5eb4e7a Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Fri, 20 Sep 2024 14:09:15 +0200 Subject: [PATCH] Don't set nil config when seeding topics in kfake cluster 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 --- pkg/kfake/data.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kfake/data.go b/pkg/kfake/data.go index 9f5d46c6..566d51b6 100644 --- a/pkg/kfake/data.go +++ b/pkg/kfake/data.go @@ -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) }