Crossplane "cannot resolve composition" for claim in CI
Crossplane matches a composite resource (or claim) to a Composition by reference, selector, or default. When none matches the resource API and labels, the status reports it cannot resolve the composition and nothing is provisioned.
What this error means
A claim or XR stays unready, and its status/events show "cannot resolve composition" or "no Composition found for ...", so kubectl waits never succeed in CI.
Warning CannotResolveComposition ... cannot resolve composition: no Composition
matched the compositeTypeRef and selector for XPostgreSQLInstanceCommon causes
No Composition matches the composite type
The Composition's compositeTypeRef does not match the XR's API group/kind, or the Composition was not applied to the cluster yet.
A label selector finds no Composition
The claim uses a compositionSelector whose labels do not match any installed Composition.
How to fix it
Apply and reference the right Composition
- Confirm the Composition exists with
kubectl get compositions. - Ensure its
compositeTypeRefmatches the XRD-defined composite type. - Set an explicit
compositionRefon the claim or fix the selector labels.
kubectl get xrd,compositions
kubectl get xpostgresqlinstance -o yaml | grep -A3 compositionRefOrder CRDs/XRDs before claims
Apply the Providers, XRDs, and Compositions and wait for them to be established before applying claims in CI.
kubectl apply -f xrd.yaml -f composition.yaml
kubectl wait --for=condition=Established xrd --all --timeout=120s
kubectl apply -f claim.yamlHow to prevent it
- Apply XRDs and Compositions before claims and wait for Established.
- Match
compositeTypeRefexactly to the composite type. - Prefer explicit
compositionRefover loose selectors in CI.