-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
allow exceptions to be specified to handle conflicting group and resource names #49224
Conversation
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.
Just super minor nits - feel free to self-lgtm.
} | ||
privateNamer := &ExceptionNamer{ | ||
Exceptions: map[string]string{ | ||
// you can put your fully qualified package like |
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.
nit - can you make those comments exactly the same? Current the order of lines is slightly different.
if exception, ok := n.Exceptions[key]; ok { | ||
return exception | ||
} | ||
|
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.
nit: remove empty line
/approve |
|
||
publicNamer := &ExceptionNamer{ | ||
Exceptions: map[string]string{ | ||
// these exceptions are used to deconflict the generated code |
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.
should we have flags for these?
As discusses in irc: /lgtm Follow-up after #49114 goes in: turn all constants in our generators into command line flags. |
/approve no-issue |
2e806e4
to
6ecc720
Compare
@sttts I will hold for your larger one to merge first. ping me when I'm good to rebase. |
comments addressed. |
/test pull-kubernetes-federation-e2e-gce |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sttts, wojtek-t Associated issue requirement bypassed by: wojtek-t The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
holding for @sttts move |
6ecc720
to
c59e211
Compare
/retest |
Automatic merge from submit-queue (batch tested with PRs 49107, 47177, 49234, 49224, 49227) |
When a group name and resource name conflict, the generated code doesn't have prefixes or suffixes to produce compiling code. Instead, it simply produces code that won't compile.
This makes it possible for the code generator to have a special kind of namer that can codify the exceptions to get compiling code. As we move the generators to become more general, this should be updated to be plumbed by flags.
@gmarek give this a try in your event pull. Specify your type and see if the names are adjusted.
@sttts we hit this downstream