-
Notifications
You must be signed in to change notification settings - Fork 209
Fix deepcopy for generics #274
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 deepcopy for generics #274
Conversation
verified against k/k - this function seems like a great target for a unit test |
d1f1f55
to
9a9c4ca
Compare
9a9c4ca
to
51ad459
Compare
51ad459
to
0dc45e1
Compare
/assign @thockin Updated with fixes. |
@Jefftree: GitHub didn't allow me to request PR reviews from the following users: TheSpiritXIII. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. 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-sigs/prow repository. |
@@ -10,5 +10,6 @@ require ( | |||
|
|||
require ( | |||
github.com/go-logr/logr v0.2.0 // indirect | |||
github.com/google/go-cmp v0.6.0 // indirect |
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.
This change is optional but I figured it'd be more useful to use cmp.Diff
instead of a two complex structs that are quite hard to read in the tests. k/k already has this dependency https://github.com/kubernetes/kubernetes/blob/master/go.mod#L38 so we are not adding anything new for them.
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Jefftree, thockin 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 |
We had a regression with the deepcopy gen not being able to handle generic fields.
This fixes the name to not be trimmed for generics in
goNameToName
and also fixes a bug with named interfaces capturing generics not capturing generics properly.