Replies: 2 comments 1 reply
-
This should in part be addressed by #4579 - the client will internally call registerCustomKind if you use the typed api for your resource - client.resources(MyCustomResource.class). After that call you would then see different deserialization behavior. The pr removes this side-effect.
What is your full stack here? I just want to make sure it's occurring at an expected place. |
Beta Was this translation helpful? Give feedback.
-
A little correction to what I wrote above, I call client.load(stream).get() (to get the resource list). Stacktrace: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
I have a template which contains definitions for normal Kube resources as well as 1 custom resource.
When I'm loading it, using client.load(stream), it sometimes deserializes the CR as "GenericKubernetesResource", saving its properties in the "additionalProperties", I get my resource list.
Once in a while, seemingly random, as I can't determine a reason, it actually deserializes the custom resource as the defined class, let's call it "MyCustomResource".
This leads to the error: io.fabric8.kubernetes.client.KubernetesClientException: Cannot edit MyCustomResource with visitors, no builder was found.
If I register a custom Kind on the "KubernetesDeserializer", then I always get this error because it never deserializes as "GenericKubernetesResource".
So, the actual question is: is there a reliable way to deserialize all the resources in the template, even if it contains kube as well as custom resources?
EDIT: As a solution, I can registerCustomKind and map the CR kind to "GenericKubernetesResource", but I was wondering if there's a better way.
Beta Was this translation helpful? Give feedback.
All reactions