crossplane / crossplane-tools

Experimental code generators for Crossplane controllers.
https://crossplane.io
Apache License 2.0
34 stars 26 forks source link

Target smaller interfaces #4

Open negz opened 5 years ago

negz commented 5 years ago

What problem are you facing?

crossplane-runtime interfaces like resource.Managed are composed of other, more tightly scoped interfaces such as resource.ClassReferencer. angryjet currently targets the broader interfaces; it will generate the resource.Managed method set for types that are support the entire functionality of resource.Managed, or it will generate nothing. This means types like Azure storage containers that look almost but not quite like a managed resource (due to missing embedded ResourceSpec) get no generated methods, despite being capable of satisfying many of the interfaces that resource.Managed is composed from.

How could Crossplane help solve your problem?

angryjet could detect the potential to satsify, and generate the methods of, smaller interfaces like resource.ClassReferencer rather than broad interfaces like resource.Managed. This may require some thought as to what files the (generally 1-2) getters and setters of these interfaces would be written to.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.