-
Notifications
You must be signed in to change notification settings - Fork 40.7k
code-generator/register-gen: groupName can't override #100738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code-generator/register-gen: groupName can't override #100738
Conversation
…roup ' to override Signed-off-by: cuisongliu <cuisongliu@qq.com>
Welcome @cuisongliu! |
Hi @cuisongliu. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @sttts /triage accepted |
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does Comments contain all comments? Note, we have this strange distinction between comments directly above something and those separated by an empty line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ic, Comments means all:
// All comments from doc.go, if any.
// TODO: remove Comments and use DocComments everywhere.
Comments []string
Do we have other places like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see the other 6 code snippets accessing groupName are fine, just this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I fount this bug just this code . other code is right.
/ok-to-test |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cuisongliu, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/release-note-none |
/retest-required |
Signed-off-by: cuisongliu cuisongliu@qq.com
What type of PR is this?
/kind bug
What this PR does / why we need it:
when I use
code-generator
to generator code . atdoc.go
add Comments// +groupName=xxx
,I found not override thisgroupName
.types.ExtractCommentTags("+", pkg.DocComments)["groupName"]
fix totypes.ExtractCommentTags("+", pkg.Comments)["groupName"]
is right