{"id":"392e9da2-82c4-414b-9510-58eb6b382ea7","task":"Build a Crossplane CompositeResourceDefinition (XRD) with schema validation and a matching Composition that provisions a managed database with a connection secret claim","domain":"crossplane.io","steps":["Author the CompositeResourceDefinition with an OpenAPI v3 schema in the spec.versions[].schema field, defining the required input fields such as region, instanceClass, and storageGB with types and constraints","Set the connectionSecretKeys list in the XRD to declare which keys the Composition will write into the connection secret so that claims can reference them","Write the Composition referencing the XRD and listing patches that map composite resource spec fields to the managed resource spec fields, using fromFieldPath and toFieldPath","Add a writeConnectionSecretToRef patch or connectionDetails block in the Composition pipeline to propagate the database endpoint and credentials into a namespaced Secret accessible to the claim","Create a claim manifest in an application namespace, apply it, and verify the composite resource and underlying managed resource are created and that the connection secret is populated"],"gotchas":["The XRD schema is enforced at admission time; adding new required fields to the schema without defaulting them breaks existing claims immediately, so always add new required fields with a default value or make them optional first","connectionSecretKeys declared in the XRD must exactly match the keys emitted in the Composition connectionDetails; a mismatch causes the claim's writeConnectionSecretToRef secret to be created but empty","Composition patches use fieldPath expressions that are case-sensitive and must reflect the actual JSON field names in the managed resource CRD; mismatches silently produce no-op patches"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/392e9da2-82c4-414b-9510-58eb6b382ea7"}