Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRD Validation Rules for Required Cross-Resource Reference Fields #325

Open
ulucinar opened this issue Jan 9, 2024 · 0 comments
Open

CRD Validation Rules for Required Cross-Resource Reference Fields #325

ulucinar opened this issue Jan 9, 2024 · 0 comments
Labels
codegen enhancement New feature or request v2
Milestone

Comments

@ulucinar
Copy link
Collaborator

ulucinar commented Jan 9, 2024

What problem are you facing?

For a cross-resource reference field `spec.forProvider.x, we generate three fields:

  1. A name reference field, e.g., spec.forProvider.xRef
  2. A label selector field, e.g., spec.forProvider.xSelector
  3. The reference target field spec.forProvider.x

Because any of these fields can be specified, upjet currently generates all of them as optional fields.

How could Upjet help solve your problem?

We had better require at least one of these reference fields via CRD validation rules, if the reference target field is marked as required in the underlying Terraform schema.

@ulucinar ulucinar added the enhancement New feature or request label Jan 9, 2024
@jeanduplessis jeanduplessis modified the milestones: 1.2, 1.3 Feb 3, 2024
@jeanduplessis jeanduplessis removed this from the 1.4 milestone Oct 20, 2024
@jeanduplessis jeanduplessis added this to the 2.x milestone Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen enhancement New feature or request v2
Projects
None yet
Development

No branches or pull requests

2 participants