Skip to content
Latchkey

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.

Crossplane
Warning  CannotResolveComposition  ...  cannot resolve composition: no Composition
matched the compositeTypeRef and selector for XPostgreSQLInstance

Common 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

  1. Confirm the Composition exists with kubectl get compositions.
  2. Ensure its compositeTypeRef matches the XRD-defined composite type.
  3. Set an explicit compositionRef on the claim or fix the selector labels.
Terminal
kubectl get xrd,compositions
kubectl get xpostgresqlinstance -o yaml | grep -A3 compositionRef

Order CRDs/XRDs before claims

Apply the Providers, XRDs, and Compositions and wait for them to be established before applying claims in CI.

Terminal
kubectl apply -f xrd.yaml -f composition.yaml
kubectl wait --for=condition=Established xrd --all --timeout=120s
kubectl apply -f claim.yaml

How to prevent it

  • Apply XRDs and Compositions before claims and wait for Established.
  • Match compositeTypeRef exactly to the composite type.
  • Prefer explicit compositionRef over loose selectors in CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →