java icon indicating copy to clipboard operation
java copied to clipboard

Version 20.0.0 is not registering model in processAot task

Open cache-sk opened this issue 1 year ago • 6 comments

Describe the bug

Project build with gradle, using org.springframework.boot and org.graalvm.buildtools.native.

As dependency we have, among others:

  • io.kubernetes:client-java
  • io.kubernetes:client-java-extended
  • io.kubernetes:client-java-spring-aot-integration

There are no problems with java build and java runtime, problem is native build with graalvm plugin.

With client versions 19.0.0 and 20.0.0-legacy, during processAot task, all model from io.kubernetes.client.openapi.models package is registered and processed to reflect-config.json.

But not with version 20.0.0, which in native build runtime ends up with root cause (for example):

java.lang.IllegalArgumentException: Type io.kubernetes.client.openapi.models.VersionInfo is instantiated reflectively but was never registered. Register the type by adding "unsafeAllocated" for the type in reflect-config.json.

I assume, that something was forgotten when implementing breaking changes..

I have already rewritten all the calls to the changes brought by version 20.0.0, I would not like to revert everything to the legacy version,

Client Version 20.0.0

Kubernetes Version 1.28.7

Java Version With client 19.0.0 was used Java 17, spring boot 3.1.5 and graalvm build tools 0.9.27. With client 20.0.0 and 20.0.0-legacy was used Java 21, spring boot 3.2.2 and graalvm build tools 0.10.0

Expected behavior Model should be registered with version 20.0.0 in same way as with 19.0.0 or 20.0.0-legacy

cache-sk avatar Feb 29 '24 18:02 cache-sk

same problem

HyoKImAbsolut avatar Mar 16 '24 07:03 HyoKImAbsolut

The issue is linked to either a missing annotation on generated model class or the way class are added in the registration class.

Today it is: https://github.com/kubernetes-client/java/blob/f13d4f4064a836fa59cf93e39532d12c2c378ce1/spring-aot/src/main/java/io/kubernetes/client/spring/aot/KubernetesBeanFactoryInitializationAotProcessor.java#L80

so scan of ApiModel but it is not existing anymore in 20 (non legacy). ex: deployment look like: https://github.com/kubernetes-client/java/blob/f13d4f4064a836fa59cf93e39532d12c2c378ce1/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1Deployment.java#L54-L56

GregoireW avatar Mar 25 '24 20:03 GregoireW

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 23 '24 20:06 k8s-triage-robot

/remove-lifecycle stale

cache-sk avatar Jun 25 '24 17:06 cache-sk

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 23 '24 18:09 k8s-triage-robot

/remove-lifecycle stale

cache-sk avatar Sep 24 '24 09:09 cache-sk

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 23 '24 09:12 k8s-triage-robot

/remove-lifecycle stale

cache-sk avatar Dec 23 '24 13:12 cache-sk

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 23 '25 14:03 k8s-triage-robot

/remove-lifecycle stale

cache-sk avatar Mar 24 '25 17:03 cache-sk

This is finally solved, thanks to new regenerated model since version 24.0.0.

cache-sk avatar Jun 12 '25 15:06 cache-sk