Replies: 2 comments 7 replies
-
Hi @lbroudoux , the dependent resource is also responsible to provide the event source. You can provide one that you initialize instead with However, the issue will be probably with the event source in this case, that is more bound to a static resource, but you can add I guess multiple classes of strimzi resources on the classpath and on runtime make sure which one to use based on the CRD present on the cluster. |
Beta Was this translation helpful? Give feedback.
-
That's an interesting use case that we indeed currently don't support well. Maybe we should look into making such a scenario simpler to deal with? |
Beta Was this translation helpful? Give feedback.
-
Hi there!
I face the case where I have to create an external Custom Resource as a dependent resource of my primary one. Typically, I have to reconcile a Strimzi.io
Kafka
andKafkaTopic
from my primary resource. As those custom resources are particularly lightweight (and also because I do not control which version of Strimzi CRD are actually deployed on the cluster and I'll probably have to manage different versions), I was thinking reconciling those features using YAML resources only.The approach I tried so far is to define a
StrimziKafkaTopicDependentResource
class that extendsKubernetesDependentResource<HasMetadata, Primary>
and implementsGarbageCollected<Primary>
. In this class, I implementHasMetadata desired(Primary primary, Context<Primary> context)
, load topic resource description as a YAML string and finally callgetKubernetesClient().resource(strimziTopic).inNamespace(microcksMetadata.getNamespace()).createOrReplace();
.The problem I'm facing is when I build an
EventSource
for this dependent resource. I try to callKubernertesDependentResource.initEventSource(context)
but ends with the following stack trace:I think I understand the issue but I'm not sure about the best way to solve this.. Is there another correct way of initializing event source in that case? Should I extend
HasMetadata
with basic implementation that provides group and version in that case? What's the best way of solving this?Thanks for help and advices!
Beta Was this translation helpful? Give feedback.
All reactions