Skip to content

Commit

Permalink
typegen: also sanitize group name to be used as a package
Browse files Browse the repository at this point in the history
  • Loading branch information
rquitales committed Sep 13, 2024
1 parent ace60fd commit fd87b8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion provider/pkg/gen/typegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,9 @@ func createGroups(definitionsJSON map[string]any, allowHyphens bool) []GroupConf

// We need to sanitize versions to be valid package names.
v = validCharRegex.ReplaceAllString(v, "_")
gStripped := validCharRegex.ReplaceAllString(gParts[0], "_")

return fmt.Sprintf("%s/%s", gParts[0], v)
return fmt.Sprintf("%s/%s", gStripped, v)
}
return linq.From([]KindConfig{
{
Expand Down

0 comments on commit fd87b8b

Please sign in to comment.