-
Notifications
You must be signed in to change notification settings - Fork 411
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
✨ Return an error for duplicate generators #829
✨ Return an error for duplicate generators #829
Conversation
Return an error from controller-gen if the command includes multiple instances of the same generator.
Welcome @rainest! |
Hi @rainest. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
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.
/lgtm
Seems reasonable to me, though I'm doubtful if we need to error out or just split out a warning. But I don't see a reason in mentioning multiple generators in the cli.
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.
/approve
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rainest, varshaprasad96, vincepri 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 |
/cherry-pick release-0.12 |
@sbueringer: new pull request created: #835 In response to this:
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. |
controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
* chore: update controller-gen version and cmd controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * chore: generate code Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> --------- Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* chore: bump controller-gen to 0.14.0 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * chore: update controller-gen cmd controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * chore: gen code Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * fix: crd codegen Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> --------- Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
* chore: update controller-gen version and cmd controller gen throws an error when multiple instances of the same generator 'crd' in this case is specified. See: kubernetes-sigs/controller-tools#829 Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * chore: generate code Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> --------- Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Return an error from controller-gen if the command includes multiple instances of the same generator. For example:
I hit the issue described in #671 and was quite confused by it.
I'm not sure if you should ever be able to specify multiple of the same generator in a single run, as this causes apparently unintended effects. In my case, only honoring the
output
directive for one and dumping the other in the default location, with no obvious way to apply theoutput
configuration to both.I'm also unsure if there's actually a way to provide a warning versus returning an error, so this does the latter. I'm not that familiar with the codebase but didn't find anything that looked like warning-level logging. Prints to stderr only show up in the top-level command code, and it doesn't make sense to issue them directly from the generator library.