snowdrop / istio-java-api

A Java API to generate Istio descriptors, inspired by Fabric8's kubernetes-model.
Apache License 2.0
112 stars 33 forks source link

Fix #126 doesn't work with shared informers #129

Closed FWiesner closed 3 years ago

FWiesner commented 3 years ago

Shared informers won't seem to synchronize

FWiesner commented 3 years ago

@metacosm I'm working on a fix

metacosm commented 3 years ago

By the way, if you're writing operators in java, I've you taken a look at https://github.com/java-operator-sdk/java-operator-sdk?

FWiesner commented 3 years ago

we took a look, but the "manual" way is more appealing to us at the moment

FWiesner commented 3 years ago

@metacosm I try adding the new Kubernetes Client OOTB annotations besides @IstioKind and @IstioApiVersion. I've made them visible to IstioTypeAnnotator and added them to istio-resource.vm Velocity template. Where I have a problem is that the standard Kubernetes annotations are apparently not in model.annotations and I have a really hard time figuring out, where model is initialized.

The particular issue I have is that @Version wants v1beta1 as there is a separate @Group annotation as well. I'm somehow not able to enrich the rendering context with the additional information needed.

metacosm commented 3 years ago

we took a look, but the "manual" way is more appealing to us at the moment

I'd be interested in hearing about why you went that way and what could be done to improve the situation if you get a chance… 😃

FWiesner commented 3 years ago

sure - Zoom, Slack, Gitter or whatever you like? ;)

metacosm commented 3 years ago

@metacosm I try adding the new Kubernetes Client OOTB annotations besides @IstioKind and @IstioApiVersion. I've made them visible to IstioTypeAnnotator and added them to istio-resource.vm Velocity template. Where I have a problem is that the standard Kubernetes annotations are apparently not in model.annotations and I have a really hard time figuring out, where model is initialized.

The particular issue I have is that @Version wants v1beta1 as there is a separate @Group annotation as well. I'm somehow not able to enrich the rendering context with the additional information needed.

Can you open a PR with what you currently have so that I can take a look, please? Make sure to make it possible for me to edit it if you don't mind.

FWiesner commented 3 years ago

@metacosm I try adding the new Kubernetes Client OOTB annotations besides @IstioKind and @IstioApiVersion. I've made them visible to IstioTypeAnnotator and added them to istio-resource.vm Velocity template. Where I have a problem is that the standard Kubernetes annotations are apparently not in model.annotations and I have a really hard time figuring out, where model is initialized. The particular issue I have is that @Version wants v1beta1 as there is a separate @Group annotation as well. I'm somehow not able to enrich the rendering context with the additional information needed.

Can you open a PR with what you currently have so that I can take a look, please? Make sure to make it possible for me to edit it if you don't mind.

did I forget to give you editing permission last time 🤭 ?

FWiesner commented 3 years ago

btw. I'm at the moment still debugging, why I have the issue with the Istio client in the first place. As the new changes in the Kubernetes Client could use some more documentation, I'm little bit in a shotgun debugging mode. the bug is possibly still in our operator code, not in the fix to #126

FWiesner commented 3 years ago

I'm trying to add the @Version, @Plural and @Group annotations due to https://github.com/fabric8io/kubernetes-client/blob/5af64095ccaa9b2a8fed79bc1b313432fd650336/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/informers/SharedInformerFactory.java#L183-L186

FWiesner commented 3 years ago

@metacosm I've pinged you on Gitter