Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The XRD input is not validated for a nonempty kind, so an empty or incorrect document can cause generation to succeed with an invalid XR instead of an actionable error.
1 open issue
What changed in this PR
Adds XRD-based kind resolution to xr generate, allowing Claim conversion to use the declared composite kind rather than relying on the X prefix convention.
Changes:
- Adds
--xrd, mutually exclusive with--kind. - Centralizes kind resolution with precedence: explicit kind, XRD kind, then the existing naming fallback.
- Adds resolution tests and a CLI usage example.
| File | Description |
|---|---|
pkg/xr/claim.go |
Adds XRD input and shared kind-resolution logic. |
pkg/xr/claim_test.go |
Tests kind-resolution precedence and fallback. |
cmd/crossplane/xr/help/generate.md |
Documents generation using --xrd. |
cmd/crossplane/xr/generate.go |
Adds the flag, loads the XRD, and passes it to conversion. |
Review effort: Balanced
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Converter tests do not pass Options.XRD to verify a composite kind differing from "X" + claimKind or rejection of an empty kind, leaving the new wiring and error path unprotected against regressions.
1 open issue
1 resolved since last review
Review effort: Balanced
05dcfb0 to
92916a7
Compare
92916a7 to
0c4a2db
Compare
Resolve the kind of the generated XR from the XRD that owns the Claim, instead of guessing "X" plus the claim's kind, which is only a naming convention. --xrd and --kind are mutually exclusive. Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
0c4a2db to
fe66b54
Compare


Description of your changes
Resolve the kind of the generated XR from the XRD that owns the Claim, instead of guessing "X" plus the Claim's kind, which is only a naming convention.
--xrdand--kindare mutually exclusive.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.