-
Notifications
You must be signed in to change notification settings - Fork 50
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 Generator is not generating multiple custom resource versions in case one version is tied to a reconciler #886
Comments
Sorry for getting back to you so late, could you elaborate on your use case a little as I'm not sure I understand correctly what you're trying to accomplish? |
Hi metacosm, We had in the beginning a custom resource with v1. This version was the only one available and it was tied to a reconciler, so it was auto generated from the java class using Fabric8 CRD generator and everything was working fine. Now the schema is changed, so we want to create v2, and we want the auto generated CRD to have both versions (v2 is stored, and v1 is only served). Generating multiple custom resource versions is supported by Fabric8 CRD generator, which is mentioned here. We created another java class for the custom resource, annotated it with v2, and tied to the reconciler, but the result was not expected. This is the observed behavior:
The desired behavior that v2 is tied to a reconciler and both versions are generated, but we couldn't achieve that. Keep in mind that the issue here is old and the used Quarkus version is old (3.10.2), so not sure if anything changed since then. I hope this explanation helps. I can provide you with a simple example in cased it is needed. |
Hi @moayad-alyaghshi, ok, this is more or less what I understood but the clarification helps! Will look into it. |
The two versions are actually generated in the same file, which is expected for CRDs. Now, the question is why |
I've opened #971 which shows the current behavior. |
@metacosm Attached is a simple example. There is a CR with two versions (only v2 is tied to a reconciler). We want both versions to be generated into the CRD. |
Hi @moayad-alyaghshi, |
Also fixes an issue with improperly recorded reconciler name and handling of generic kubernetes resources. Fixes #886 Signed-off-by: Chris Laprun <[email protected]>
Let me know if the associated PR solves your issue. |
Yes, generating the versions in the same CRD file is acceptable. |
#973) Also fixes an issue with improperly recorded reconciler name and handling of generic kubernetes resources. Fixes #886 Signed-off-by: Chris Laprun <[email protected]>
Hi,
Fabric8 CRD generator supports multiple versions of the same kind:
https://github.com/fabric8io/kubernetes-client/blob/main/doc/CRD-generator.md#multiple-custom-resource-versions
This does not work for us. We have two versions (v1 and v2) of the same custom resource. We set quarkus.operator-sdk.crd.generate-all to true. When no version is tied to a reconciler, both versions will be generated, but when we use one version (v2) by the reconciler, only this version is generated and the other (v1) is ignored.
Is this intended behavior or a bug?
note: Quarkus platform version is 3.10.2
The text was updated successfully, but these errors were encountered: