Create an interface for retrieving duck-type fields#1275
Conversation
Co-authored-by: Matt Moore <mattmoor@vmware.com>
|
The following is the coverage report on the affected files.
|
|
/hold I'm not sure if this is going to work without some reflection. There isn't a way in golang to dynamically test if a resource implements an interface and then run logic on it that way. The advantage of this would be instead of #1261 we'd reflect an instance of KRShaped from our type and from there we could create common logic (instead of duplicating that logic with the generator) |
|
/unhold nah let's keep going with this. As long as we still create a new tag to genreconciler we'll only do this for KRShaped things. At least now we can create unit-testable functions on this type more easily instead of doing it all directly in the generated code. |
|
/hold cancel |
| // KRShaped is an interface for retrieving the duck elements of an arbitraty resource. | ||
| type KRShaped interface { | ||
| GetTypeMeta() *metav1.TypeMeta | ||
|
|
There was a problem hiding this comment.
I think these come from RuntimeObject
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: n3wscott, whaught The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue #1226