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

Recursive Types #460

Open
IfSentient opened this issue Nov 5, 2024 · 1 comment
Open

Recursive Types #460

IfSentient opened this issue Nov 5, 2024 · 1 comment

Comments

@IfSentient
Copy link
Contributor

Because CRDs cannot handle recursive types natively, we do not currently support recursive codegen from the CLI ("do not currently support" in this case means "CLI freezes up when CUE attempts to convert the recursive CUE type to OpenAPI). However, there are definitely use-cases for recursive types within app platform, so we should evaluate if we want to support recursive types in any possible case. Some questions:

  • If we support recursive types in any way, how does this impact the app manifest, which inlines the schemas?
  • Do we want to extend apiextensions to handle recursive types?
  • Do we want to only generate code for the recursive types, and use kubernetes-preserve-unknown-fields: true on an empty object when generating the schema (as suggested in this kubernetes issue? We could use webhook validation to check that the actual data is correct on create/update.
  • How does this impact other tooling and/or service discovery?
@radiohead
Copy link
Contributor

However, there are definitely use-cases for recursive types within app platform

Do we have any real requests / questions / examples?

Do we want to only generate code for the recursive types, and use kubernetes-preserve-unknown-fields: true on an empty object when generating the schema (as suggested in kubernetes-sigs/controller-tools#585?

I would prefer that for a V1 / V0 approach. We could start there and investigate changing apiextensions code to support recursive types natively later.

@IfSentient IfSentient self-assigned this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants