Crossplane "crossplane beta render" error in CI
crossplane beta render runs your composition through its function pipeline locally and prints the resources it would create. It fails when a required argument is missing, a function image cannot run, or the composition and XR do not line up.
What this error means
A PR step running crossplane beta render xr.yaml composition.yaml functions.yaml errors instead of printing rendered resources, often naming a function or a file it could not load.
crossplane: error: cannot render composite resource: cannot run function pipeline:
cannot run function "function-patch-and-transform": cannot get function:
Function.pkg.crossplane.io "function-patch-and-transform" not foundCommon causes
The functions file does not declare a used function
The composition references a function that is not present in the functions.yaml passed to render, so the pipeline cannot run it.
A missing file or malformed input argument
The XR, composition, or functions path is wrong, or the XR does not match the composition it is rendered against.
How to fix it
Pass every referenced function to render
- List the functions your composition pipeline references.
- Declare each one in a
functions.yamlwith its runtime annotation. - Pass XR, composition, and functions to render.
crossplane beta render xr.yaml composition.yaml functions.yamlDeclare the function with a Development runtime
For local render, point the function to a running Development endpoint or its package so the CLI can invoke it.
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-patch-and-transform
spec:
package: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.7.0How to prevent it
- Render compositions in PR before applying them to a cluster.
- Keep a
functions.yamlthat lists every function the pipeline uses. - Commit example XRs so render has a real input to work from.