Documentation
¶
Overview ¶
Package composite renders a composite resource (XR) by running one real reconcile loop against a fake in-memory client. It is intended as an internal engine for tools like 'crossplane render' and 'up test run'.
Index ¶
- func BuildOutput(c *render.InMemoryClient, isPrimary func(kunstructured.Unstructured) bool, ...) (*renderv1alpha1.CompositeOutput, error)
- func CompositionSelector(comp *apiextensionsv1.Composition) composite.CompositionSelectorFn
- func InjectResourceRefs(xr *ucomposite.Unstructured, observed []kunstructured.Unstructured)
- func Render(ctx context.Context, log logging.Logger, in *renderv1alpha1.CompositeInput) (*renderv1alpha1.CompositeOutput, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOutput ¶
func BuildOutput(c *render.InMemoryClient, isPrimary func(kunstructured.Unstructured) bool, rec *render.EventRecorder, rrf *render.RecordingRequiredResourcesFetcher, rsf *render.RecordingRequiredSchemasFetcher) (*renderv1alpha1.CompositeOutput, error)
BuildOutput assembles a CompositeOutput from the fake client's captured state and the event recorder. The isPrimary predicate identifies the primary resource (the XR) so it can be separated from composed resources.
func CompositionSelector ¶
func CompositionSelector(comp *apiextensionsv1.Composition) composite.CompositionSelectorFn
CompositionSelector returns a CompositionSelectorFn that sets the composition reference on the XR to point to the supplied Composition.
func InjectResourceRefs ¶
func InjectResourceRefs(xr *ucomposite.Unstructured, observed []kunstructured.Unstructured)
InjectResourceRefs sets spec.resourceRefs on the XR for each observed resource. The real ExistingComposedResourceObserver reads these refs to discover existing composed resources. Any preexisting refs are replaced.
func Render ¶
func Render(ctx context.Context, log logging.Logger, in *renderv1alpha1.CompositeInput) (*renderv1alpha1.CompositeOutput, error)
Render runs one real XR reconcile loop using the real reconciler engine backed by a fake in-memory client.
Types ¶
This section is empty.