crossplane / upjet

A code generation framework and runtime for Crossplane providers
Apache License 2.0
293 stars 84 forks source link

examples: add a common helper for operations to be run in all manifests of an example #59

Closed muvaf closed 11 months ago

muvaf commented 2 years ago

What problem are you facing?

In https://github.com/upbound/upjet/pull/15#discussion_r932338303 , @ulucinar proposed a concept called ExampleModifier that is a function that's applied to example manifest and also its dependencies but we didn't implement it because it was too close to what config.ResourceOptions are doing.

How could Terrajet help solve your problem?

We can implement a common helper function whose input is a func that operates the same way ExampleModifier does and returns a config.ResourceOption that runs that function through all manifests. This would help us write less code when we'd like to modify examples.

ulucinar commented 11 months ago

During the course of time, we have decided to maintain separate manually written example manifests for uptesting, which makes this issue obsolete. We may revisit this if we decide to use the generated examples for uptesting.