mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
informer-gen: allow package names containing dots
Before 73dc5a96de
,
informer-gen calculated the effective package name by using the first
segment of the groupName.
After the commit, the package name is calculated directly from the
PackageName specified, without any normalizations. This meant that if
the actual PackageName contains dots, the effective package name
can now contain dots too. However, this doesn't work well while
parsing files. This also introduced a regression since dots can no longer
be specified in package names.
To fix this, this commit introduces the same normalizations on the
PackageName i.e. the effective package name now uses the first segment
of PackageName.
This commit is contained in:
parent
9b376e4e8e
commit
802fed53e3
@ -283,9 +283,10 @@ func factoryInterfacePackage(basePackage string, boilerplate []byte, clientSetPa
|
||||
|
||||
func groupPackage(basePackage string, groupVersions clientgentypes.GroupVersions, boilerplate []byte) generator.Package {
|
||||
packagePath := filepath.Join(basePackage, groupVersions.PackageName)
|
||||
groupPkgName := strings.Split(string(groupVersions.PackageName), ".")[0]
|
||||
|
||||
return &generator.DefaultPackage{
|
||||
PackageName: groupVersions.PackageName,
|
||||
PackageName: groupPkgName,
|
||||
PackagePath: packagePath,
|
||||
HeaderText: boilerplate,
|
||||
GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) {
|
||||
|
Loading…
Reference in New Issue
Block a user