Skip to content

Commit

Permalink
fix: prevent pubsub naming clashes (#3522)
Browse files Browse the repository at this point in the history
Topic or subscription `a.b_c` would have previously clashed with `a_b.c`
as we were separating module and name by underscores
  • Loading branch information
matt2e authored Nov 26, 2024
1 parent b2d950c commit b72659f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/provisioner/dev_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b72659f

Please sign in to comment.