-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make it possible to generate CRDs for all detected CustomResources even when not used by a Controller #90
Comments
i was trying out the joke samples - and just wanted to add that until this issue gets fixed, the only way i found to generate the CRD for jokes.samples.javaoperatorsdk.io-v1.yml was to use this directly in the pom.xml <dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-apt</artifactId>
<version>5.9.0</version>
<scope>compile</scope>
</dependency> and then: oc apply -f target/classes/META-INF/fabric8/jokes.samples.javaoperatorsdk.io-v1.yml otherwise you get an api error in your JokeRequest status:
error: true
message: |-
Error querying API: Failure executing: POST at: https://api.openshift-<your cluster domain>:6443/apis/samples.javaoperatorsdk.io/v1alpha1/namespaces/java-operator/jokes. Message: 404 page not found hopefully that helps someone trying out the samples for the first time ! thx. |
Yes indeed. This issue's existence is based on that sample's UX: you do indeed need to use the APT dependency to generate the |
I think having an |
That's a common use case, indeed. However, this doesn't change the fact that custom resources not directly declared by your controllers won't be generated automatically by the extension. Adding the |
+1 on keeping the original |
I can confirm this is a common use case, especially now that JOSDK supports dependent resources. You thus often end up with one reconciler that watches / handles multiple custom resources (a primary and one or more secondary). I confirm the CRDs are still not generated without a reconciler. Will this be fixed soon ? Or can we have an annotation on the CRs that specifies which CRDs must be generated ? |
I will revive this and see what can be done. |
An initial stab at implementing this feature is provided in #399. Please give it a try and let me know if you encounter any issues. |
It can happen that a project might need to reference Custom Resources that are not directly under the control of the operator. While this is an atypical use case, it might be interesting to generate the associated CRDs when asked to do so.
The text was updated successfully, but these errors were encountered: