Skip to content

Commit 5763f78

Browse files
author
Daniel Vaseekaran
committed
Update Test Case
1 parent 9a63710 commit 5763f78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

controllers/tests/kafkacluster_controller_kafka_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,11 @@ func expectKafkaBrokerPod(ctx context.Context, kafkaCluster *v1beta1.KafkaCluste
366366
}).Should(HaveLen(1))
367367

368368
pod := podList.Items[0]
369-
370-
Expect(pod.GenerateName).To(Equal(fmt.Sprintf("%s-%d-", kafkaCluster.Name, broker.Id)))
369+
if kafkaCluster.Spec.KRaftMode && broker.BrokerConfig.IsControllerNode() {
370+
Expect(pod.GenerateName).To(Equal(fmt.Sprintf("%s-controller-%d-", kafkaCluster.Name, broker.Id)))
371+
} else {
372+
Expect(pod.GenerateName).To(Equal(fmt.Sprintf("%s-%d-", kafkaCluster.Name, broker.Id)))
373+
}
371374
Expect(pod.Labels).To(HaveKeyWithValue(v1beta1.BrokerIdLabelKey, strconv.Itoa(int(broker.Id))))
372375
getContainerName := func(c corev1.Container) string { return c.Name }
373376
// test exact order, because if the slice reorders, it triggers another reconcile cycle

0 commit comments

Comments
 (0)