Repository navigation
Conversation
Crossplane creates the XR of a claim with `metadata.generateName` set to the Claim's name and a hyphen, and the API server appends the random suffix to make the name. Set `generateName` on the generated XR as well, so that it matches the XR Crossplane creates. A direct XR is unchanged. Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
tampakrap
requested review from
phisco
and
a balanced review from Copilot
and removed request for
a team
November 26, 2026 13:24
There was a problem hiding this comment.
🟡 Changes recommended
The shared test expectation builder omits metadata.generateName, causing the missing-backing-XR, new-claim, and unbound-claim tests to fail their full-object comparisons.
1 open issue
What changed in this PR
Aligns claim-derived composite resources (XRs) generated by the CLI with Crossplane’s metadata, supporting rendering and composition-testing workflows.
Changes:
- Sets
metadata.generateNameto<claim-name>-for claim-derived XRs, including those with an explicit name. - Updates converter test expectations while leaving direct-XR behavior unchanged.
| File | Description |
|---|---|
pkg/xr/claim.go |
Adds claim-derived generateName in non-direct mode. |
pkg/xr/claim_test.go |
Updates expected metadata for claim-derived XRs. |
Review effort: Balanced
tampakrap
marked this pull request as draft
November 26, 2026 13:56
`ConvertClaimToXR` now sets `metadata.generateName` on the XR it generates from a Claim, as Crossplane does for the XR of a Claim. The composite resolver calls it (not direct, with an explicit name) to synthesize the backing XR of a Claim that has none in the cluster, so that XR carries `metadata.generateName` as well. Add it to the expectation of the synthesized XR in the composite resolver tests. Only the expectation changes: the resolver is not touched, and the integration suites that exercise it (xr and composition composition simulate) pass unchanged. Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description of your changes
Crossplane creates the XR of a claim with
metadata.generateNameset to the Claim's name and a hyphen, and the API server appends the random suffix to make the name.Set
generateNameon the generated XR as well, so that it matches the XR Crossplane creates. A direct XR is unchanged.Related:
I have:
./nix.sh flake checkto ensure this PR is ready for review.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.