Skip to content

Commit

Permalink
Fix regression in main
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkats-db committed Jul 19, 2024
1 parent f2553ff commit fb902c9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bundle/config/mutator/apply_presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ func toTagArray(tags map[string]string) []Tag {
// We leave unicode letters and numbers but remove all "special characters."
func normalizePrefix(prefix string) string {
prefix = strings.ReplaceAll(prefix, "[", "")
prefix = strings.ReplaceAll(prefix, "] ", "_")
return textutil.NormalizeString(prefix)
prefix = strings.Trim(prefix, " ")

// If the prefix ends with a ']', we add an underscore to the end.
// This makes sure that we get names like "dev_user_endpoint" instead of "dev_userendpoint"
suffix := ""
if strings.HasSuffix(prefix, "]") {
suffix = "_"
}

return textutil.NormalizeString(prefix) + suffix
}

0 comments on commit fb902c9

Please sign in to comment.