-
Notifications
You must be signed in to change notification settings - Fork 427
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
🐛Fix panic on anonymous nested struct in CRD #415
🐛Fix panic on anonymous nested struct in CRD #415
Conversation
Anonymous nested structs are not allowed according to the error message, but the code was panicking because for such struct `ctx.info.RawSpec` is nil. This commit adds extra checks so that struct name must be present and spec must not be nil.
this is helpful, please review |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
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
/assign @alvaroaleman
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hypnoglow, 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 |
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.
@hypnoglow can you add a testcase for this?
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
@hypnoglow do you have time to add a test case as @alvaroaleman suggested? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
@hypnoglow Do you have time to add a test for this issue? |
Hey, sorry for not responding for long. As I mentioned in the first message, I wasn't sure where and how I could add the test for this. It would be really helpful if you could guide me a little. Maybe something has changed since I opened the MR and there is an obvious place for the test, then I'll look into it in the nearest days. |
@hypnoglow I think the test can be added in https://github.com/kubernetes-sigs/controller-tools/tree/master/pkg/crd/testdata where you can add a nested object inside @vincepri @alvaroaleman do you think this is a good way to go? I am posting this as I have something similar I was going to ask how to go on doing it and found this issue. hope you get it merged soon! |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closed this PR. 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. |
Anonymous nested structs are not allowed according to the error message, but the code was panicking because for such struct
ctx.info.RawSpec
is nil.This change adds extra checks so that struct name must be present and spec must not be nil.
Fixes #340 (which was closed recently by bot)
Not sure if it is possible to add a test for this somewhere 🤔. I tested locally:
Running
make manifests
on master:Running
make manifests
with this PR applied: