Skip to content

Commit

Permalink
Ignore ValidationSchema that results in registering all models
Browse files Browse the repository at this point in the history
`ValidationSchema` is annotated with `@JsonDeserialize` which leads in
its entire type hierarchy being registered for reflective access along
with the corresponding methods. This essentially ends up registering all
models as in kubernetes-client 6.9.0 ValidationSchema was augmented to
implement `Editable<ValidationSchemaBuilder>`, which increases the
reachable types in comparison to previous versions.

Ignoring registrations for `ValidationSchema` aligns with what we
already do for `KubeSchema`.

Fixes quarkusio#38683

(cherry picked from commit 637ebea)
  • Loading branch information
zakkak authored and gsmet committed Feb 20, 2024
1 parent 4d54338 commit 943784b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.fabric8.kubernetes.api.model.KubeSchema;
import io.fabric8.kubernetes.api.model.KubernetesResource;
import io.fabric8.kubernetes.api.model.KubernetesResourceList;
import io.fabric8.kubernetes.api.model.ValidationSchema;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
Expand Down Expand Up @@ -66,6 +67,7 @@ public class KubernetesClientProcessor {
private static final DotName RESOURCE_EVENT_HANDLER = DotName
.createSimple(io.fabric8.kubernetes.client.informers.ResourceEventHandler.class.getName());
private static final DotName KUBERNETES_RESOURCE = DotName.createSimple(KubernetesResource.class.getName());
private static final DotName VALIDATION_SCHEMA = DotName.createSimple(ValidationSchema.class.getName());
private static final DotName KUBERNETES_RESOURCE_LIST = DotName
.createSimple(KubernetesResourceList.class.getName());
private static final DotName KUBE_SCHEMA = DotName.createSimple(KubeSchema.class.getName());
Expand Down Expand Up @@ -190,6 +192,7 @@ public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBui
ignoredJsonDeserializationClasses.produce(
new IgnoreJsonDeserializeClassBuildItem(KUBERNETES_RESOURCE_LIST));
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(KUBERNETES_RESOURCE));
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(VALIDATION_SCHEMA));

final String[] deserializerClasses = combinedIndexBuildItem.getIndex()
.getAllKnownSubclasses(DotName.createSimple("com.fasterxml.jackson.databind.JsonDeserializer"))
Expand Down

0 comments on commit 943784b

Please sign in to comment.