diff --git a/content/master/concepts/composition-functions.md b/content/master/concepts/composition-functions.md index 5289ab26..a7659fe4 100644 --- a/content/master/concepts/composition-functions.md +++ b/content/master/concepts/composition-functions.md @@ -96,26 +96,38 @@ Crossplane has four core components that users commonly mix up: namespace scoping. {{}} -You must set the Composition {{}}mode{{}} -to `Pipeline` to use a Function. To use a Function, add a {{}}pipeline{{}} of steps inside your Composition -{{}}spec{{}}. +To use composition functions set the Composition +{{}}mode{{}} to +{{}}Pipeline{{}}. -The pipeline must have a step {{}}step{{}} that calls the Function. The {{}}step{{}} must specify the {{}}name{{}} of the Function to call. Here the step references -the name {{}}function-patch-and-transform{{}}. +Define a {{}}pipeline{{}} of +{{}}steps{{}}. Each +{{}}step{{}} calls a Function. -Some Functions allow you to specify an {{}}input{{}}. Different Functions each have a different -{{}}kind{{}} of input. This example uses -[Function Patch and Transform](https://github.com/crossplane-contrib/function-patch-and-transform). -Function Patch and Transform is a function that implements Crossplane resource -templates. Its input kind is `Resources`, and it accepts -[Patch and Transform]({{}}) {{}}resources{{}} as input. +Each {{}}step{{}} uses a +{{}}functionRef{{}} to reference the +{{}}name{{}} of the Function to call. + +{{}} +Compositions using {{}}mode: Pipeline{{}} +can't specify resource templates with a `resources` field. + +Use function "Patch and Transform" to create resource templates. +{{< /hint >}} + + +Some Functions also allow you to specify an +{{}}input{{}}. +The function defines the +{{}}kind{{}} of input. + +This example uses +[Function Patch and Transform](https://github.com/crossplane-contrib/function-patch-and-transform). +Function Patch and Transform implements Crossplane resource +templates. +The input kind is {{}}Resources{{}}, +and it accepts [Patch and Transform]({{}}) +{{}}resources{{}} as input. ```yaml {label="single",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -141,11 +153,6 @@ spec: region: "us-east-2" ``` -{{}} -You can't specify resource templates using the Composition's `spec.resources` -field when you use composition functions. When a Composition's `spec.mode` is -`Pipeline` you can only specify `spec.pipeline`. -{{< /hint >}} ## Use a pipeline of functions in a composition @@ -153,18 +160,12 @@ Crossplane can ask more than one Function what to do when a composite resource changes. When a Composition has a pipeline of two or more steps, Crossplane calls them all. It calls them in the order they appear in the pipeline. - - Crossplane passes each Function in the pipeline the result of the previous Function. This enables powerful combinations of Functions. In this example, Crossplane calls {{}}function-cue{{}} to -create an S3 bucket. Crossplane then passes the bucket to {{}}function-auto-ready{{}}, which marks the +create an S3 bucket. Crossplane then passes the bucket to +{{}}function-auto-ready{{}}, which marks the composite resource as ready when the bucket becomes ready. - ```yaml {label="double",copy-lines="none"} apiVersion: apiextensions.crossplane.io/v1 @@ -315,7 +316,7 @@ run. `crossplane beta render` supports two `render.crossplane.io/runtime` values: * `Docker` (the default) connects to Docker Engine. It uses Docker to pull and - run function runtimes. + run a function runtime. * `Development` connects to a function runtime you have run manually. When you use the {{}}Development{{}} diff --git a/content/master/concepts/compositions.md b/content/master/concepts/compositions.md index 9e379414..f9666c6d 100644 --- a/content/master/concepts/compositions.md +++ b/content/master/concepts/compositions.md @@ -679,19 +679,29 @@ default. The page explains how to disable composition functions. {{< /hint >}} -To use composition functions define a {{}}pipeline{{}} of steps inside the Composition {{}}spec{{}}. Each {{}}step{{}} calls a Function. You can't specify resource -templates using the `resources` field when you specify a pipeline of functions. -You must set the Composition {{}}mode{{}} to -`Pipeline` to use Functions. +To use composition functions set the Composition +{{}}mode{{}} to +{{}}Pipeline{{}}. -Each {{}}step{{}} must specify the {{}}name{{}} of the Function to call. Some Functions -also allow you to specify an {{}}input{{}}. -Different Functions each have a different {{}}kind{{}} of input. +Define a {{}}pipeline{{}} of +{{}}steps{{}}. Each +{{}}step{{}} calls a Function. + +Each {{}}step{{}} uses a +{{}}functionRef{{}} to reference the +{{}}name{{}} of the Function to call. + +Some Functions also allow you to specify an +{{}}input{{}}. +The function defines the +{{}}kind{{}} of input. + +{{}} +Compositions using {{}}mode: Pipeline{{}} +can't specify resource templates with a `resources` field. + +Use function "Patch and Transform" to create resource templates. +{{< /hint >}} This example uses Function Patch and Transform. Function Patch and Transform is a function that implements Crossplane resource templates. You can use Function