From b72659ff9078383bd6ab541fd612c5585883f284 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 26 Nov 2024 13:59:05 +1100 Subject: [PATCH] fix: prevent pubsub naming clashes (#3522) Topic or subscription `a.b_c` would have previously clashed with `a_b.c` as we were separating module and name by underscores --- backend/provisioner/dev_provisioner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/provisioner/dev_provisioner.go b/backend/provisioner/dev_provisioner.go index 51fd894d6..ce0da6cba 100644 --- a/backend/provisioner/dev_provisioner.go +++ b/backend/provisioner/dev_provisioner.go @@ -265,11 +265,11 @@ func provisionSubscription() func(ctx context.Context, rc *provisioner.ResourceC } func kafkaTopicID(module, id string) string { - return shortenString(fmt.Sprintf("%s-%s", module, id), pubSubNameLimit) + return shortenString(fmt.Sprintf("%s.%s", module, id), pubSubNameLimit) } func consumerGroupID(module, id string) string { - return shortenString(fmt.Sprintf("%s-%s", module, id), pubSubNameLimit) + return shortenString(fmt.Sprintf("%s.%s", module, id), pubSubNameLimit) } // shortenString truncates the input string to maxLength and appends a hash of the original string for uniqueness