Merge pull request #100738 from cuisongliu/bug_register-gen_groupName

code-generator/register-gen: groupName can't override
This commit is contained in:
Kubernetes Prow Robot 2021-08-05 08:17:22 -07:00 committed by GitHub
commit 01d2ee8e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)