-
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
The property quarkus.operator-sdk.crd.apply
is ignored
#242
Comments
The property is not ignored, but, indeed, it only works for dev mode on purpose (because applying a CRD automatically to a cluster is probably not a good idea when you're not developing your operator). It doesn't do anything if the operator is not running. Applying the CRD without the operator running would actually require to spawn a separate process, which, granted, could be done during the build. |
Ok, so I would add a comment in the property to state that this is only intended to work on DEV mode. |
Do you think it would make sense to convert this issue into a feature request to support application of the CRD at build time? If not, we should close this issue. |
From my point of view, the CRD should always be applied/updated when running the application on DEV mode, otherwise is not guaranteed that the CRD is up to date with what the CRD that has been just auto-generated. So, when users use this property to the Maven command, I'd expect that the CRD is always applied even when I'm not running the application on DEV mode. In summary, I'd be ok to convert this issue into a feature request. |
This is indeed a valid point. Maybe I should just convert the default to
👍🏼 |
When enabling `quarkus.operator-sdk.crd.apply=true` at build time, we will register the CRD in the Kubernetes cluster where user is logged in. Updated documentation and added a note saying that this will always be done when running the application on Dev mode. Fix quarkiverse#242
Reverting this change because it doesn't really make sense to apply the CRD to the cluster that's available at build time as opposed to runtime. Also, this causes the CRD to be applied several times at the moment, which is inefficient. Revert commit: e864518 |
How to reproduce?
You can reproduce this issue by using the samples/joke example:
cd samples/joke
The auto-generated JokeRequest CRD is not installed.
Problem
I think that the problem is that this is done when creating an instance of the
Operator
(see https://github.com/quarkiverse/quarkus-operator-sdk/blob/main/core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/OperatorProducer.java#L37). Therefore, this won't ever be applied at build time, but only at runtime when injecting theOperator
.The text was updated successfully, but these errors were encountered: