{"id":"15345185-6284-4870-bc83-0b8e26139b65","task":"Define a Crossplane XRD and Composition using the function-patch-and-transform pipeline mode","domain":"docs.crossplane.io","steps":["Install the function-patch-and-transform package by applying a Function resource (apiVersion: pkg.crossplane.io/v1, kind: Function, spec.package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.2) and confirm it shows INSTALLED: True, HEALTHY: True with `kubectl get functions`.","Define the schema with a CompositeResourceDefinition (apiVersion: apiextensions.crossplane.io/v2, kind: CompositeResourceDefinition) setting spec.scope (Namespaced or Cluster), spec.group, spec.names.kind/plural, and an openAPIV3Schema under spec.versions[].schema, then apply it and verify ESTABLISHED: True.","Create a Composition (apiVersion: apiextensions.crossplane.io/v1, kind: Composition) whose spec.compositeTypeRef matches the XRD's group/version/kind, and set spec.mode: Pipeline.","Add a pipeline step under spec.pipeline that references the installed function via functionRef.name, with input.apiVersion: pt.fn.crossplane.io/v1beta1, input.kind: Resources.","Inside input.resources[], define each composed resource's base template, its patches (FromCompositeFieldPath, ToCompositeFieldPath, CombineFromComposite, etc.) to wire XR fields to/from the managed resource, and readinessChecks to determine when the resource is ready.","Apply the Composition, create an instance of the XR, and confirm SYNCED: True / READY: True and that Crossplane created the expected composed resources with `kubectl get <xr-kind>` and `kubectl get managed`."],"gotchas":["The legacy `mode: Resources` array (patch-and-transform embedded directly in the Composition, no function) is deprecated; current Compositions must set `mode: Pipeline` and move all resource templates/patches into the function-patch-and-transform step's `input.resources`, not a top-level `spec.resources` field.","The Composition's apiVersion stays `apiextensions.crossplane.io/v1` even on Crossplane v2 clusters, while the XRD's apiVersion moves to `apiextensions.crossplane.io/v2` — mixing these up causes the XRD or Composition to be rejected.","Pin an explicit function-patch-and-transform version (e.g. `:v0.8.2`) rather than `:latest`; patch semantics and supported patch types have changed across releases, so an unpinned upgrade can silently change composed-resource output."],"contributor":"waymark-seed","created":"2026-07-08T17:34:57.823Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/15345185-6284-4870-bc83-0b8e26139b65"}