Skip to content

feat(claimtoxr): add Options API with Name and UID#122

Merged
tampakrap merged 1 commit into
crossplane-contrib:mainfrom
tampakrap:convertclaimtoxr_options
May 9, 2026
Merged

feat(claimtoxr): add Options API with Name and UID#122
tampakrap merged 1 commit into
crossplane-contrib:mainfrom
tampakrap:convertclaimtoxr_options

Conversation

@tampakrap

Copy link
Copy Markdown
Collaborator

Replace ConvertClaimToXR's args with an Options struct, adding two new ones:

  • Name: explicit XR name, overrides the direct-mode default (Claim name) or the non-direct random suffix
  • GenerateUID: set metadata.uid via uuid.NewUUID()

Existing Kind and Direct arguments are unchanged. The runner's call site uses Options{} (without values) matching the previous behavior.

Also, the function now reutnrs *composite.Unstructured rather thant *unstructured.Unstructured, since the produced object is conceptually a Composite Resource. YAML/JSON marshaling continues to work via the embedded unstructured.Unstructured.

The xprin-helpers convert-claim-to-xr command exposes the new options as --name and --gen-uid flags. Documentation is updated accordingly.

Replace ConvertClaimToXR's args with an Options struct, adding two new
ones:

- Name: explicit XR name, overrides the direct-mode default (Claim name)
  or the non-direct random suffix
- GenerateUID: set `metadata.uid` via `uuid.NewUUID()`

Existing Kind and Direct arguments are unchanged. The runner's call site
uses Options{} (without values) matching the previous behavior.

Also, the function now reutnrs `*composite.Unstructured` rather thant
`*unstructured.Unstructured`, since the produced object is conceptually
a Composite Resource. YAML/JSON marshaling continues to work via the
embedded `unstructured.Unstructured`.

The `xprin-helpers convert-claim-to-xr` command exposes the new options
as `--name` and `--gen-uid` flags. Documentation is updated accordingly.

Signed-off-by: Theo Chatzimichos <tampakrap@gmail.com>
@tampakrap tampakrap merged commit b4294cc into crossplane-contrib:main May 9, 2026
6 checks passed
@tampakrap tampakrap deleted the convertclaimtoxr_options branch May 9, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant