code-generator/register-gen: groupName can't use '// +groupName=somegroup ' to override

Signed-off-by: cuisongliu <cuisongliu@qq.com>
This commit is contained in:
cuisongliu 2021-04-01 14:44:20 +08:00
parent a651804427
commit 68ec18a050

View File

@ -82,7 +82,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
// if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io",
// extract the fully qualified API group name from it and overwrite the group inferred from the package path
if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil {
if override := types.ExtractCommentTags("+", pkg.Comments)["groupName"]; override != nil {
groupName := override[0]
klog.V(5).Infof("overriding the group name with = %s", groupName)
gv.Group = clientgentypes.Group(groupName)