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
  • Loading branch information
zakkak committed Feb 20, 2024
1 parent da7f89a commit 637ebea
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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 @@ -67,6 +68,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 @@ -189,6 +191,7 @@ public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBui
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(KUBE_SCHEMA));
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(KUBERNETES_RESOURCE_LIST));
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(KUBERNETES_RESOURCE));
ignoredJsonDeserializationClasses.produce(new IgnoreJsonDeserializeClassBuildItem(VALIDATION_SCHEMA));

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

0 comments on commit 637ebea

Please sign in to comment.