-
Notifications
You must be signed in to change notification settings - Fork 218
Conditionally register a dependent resource via @Dependent #2063
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
Comments
One workaround is to use the standalone configuration of dependent resources instead of |
When you register a CRUDKubernetesDependentResource<Route, P> via
you will get this stack trace:
|
I see this as a valid use case. This can happen, usually with openshift vs kubernetes, but also in cases for example when the controller implentation would change based on some other capabilities of the cluster, thus is there are other custom resource definitions present. |
I see multiple possibilities how to approach the solution, one is that we will introduce a new condition, maybe
The question is what should happen if there are resources that are depend on such resource? Those should not be reconciled either? I guess so, since Alternatively it could just ignore the resource as it was not there, but that rather fits for the (not implemented) |
I would say that according to the semantics of
+1 to support changes at runtime. |
yes, I meant this way, just compared it to |
Maybe |
I would rather refer to an offical term (though I can't find one in the docs) used in the workflow definition to describe the transition into this state of becoming active. How would you define the process of enabling the KubernetesDependentResource? Some proposals:
|
IMO this very much depends on how we look on this,
So yeah, IMO then |
The problem with dynamic (runtime) handling is that, registering a dependent resource need also an event source / informer. But registering that in runtime is a bit problematic. Basically it needs to "stop the world", thus processing until the Informer is synced. |
Came back to this, thinking about runtime registration, although Kubernetes API is dynamic in terms of how CRDs are registered. The dynamic registration of EventSources is possible, would be even a possible nice feature for other (special) use cases, but also brings complexity. Thus would be harder to understand for users what is happening in the background. |
On the other hand if the this decision is made on startup, there might be some ordering issues, like of the operator checks if there is cert manager installed on the cluster or not, this would be nicer to do dynamically. Since when starting a (test) cluster and installing components would need some ordering. Thus first install cert manager (at least CRD) the run the controller. |
We need some way to register a dependent resource based on a certain condition via
@Dependent
annotation. One use case is to disable dependent resources that are not available in a particular environment, e.g. when using a Route resource that is only available in OpenShift. For this use case it is not enough to specify a reconcilePrecondition because even when the condition evaluates to false, the controller will still try access the api causing an error.The text was updated successfully, but these errors were encountered: