Skip to content

Conversation

@desiderantes
Copy link

@desiderantes desiderantes commented Nov 28, 2024

Avoids inconsistency with Spring Boot 3.4.0 which requires gson 2.11.x due to the com.google.gson.Strictness class

@wind57
Copy link
Contributor

wind57 commented Nov 28, 2024

afaik, this is treated as a "breaking change" and such upgrades are only possible in next major releases. Also, we have dependabot that should take care of this... I'll wait for @ryanjbaxter to provide his input.

@ryanjbaxter
Copy link
Contributor

ryanjbaxter commented Nov 28, 2024

Are you getting some kind of runtime exception using Boot 3.4.0?

@desiderantes
Copy link
Author

Are you getting some kind of runtime exception using Boot 3.4.0?

Yes, kubernetes client java is pulling Gson 2.10.1, and it's downgrading it from 2.11, which is required on spring boot 3.4.0 because now the gson configuration class, GsonProperties, uses the Strictness class from latest gson. This, for example, breaks spring-boot-admin when used with kubernetes discovery. Of course, I can just force the gson version via the build system, but it's doing the wrong thing by default.

@xcq1
Copy link

xcq1 commented Dec 5, 2024

I stumbled on this while encountering kubernetes-client/java#1659 and trying to use a fixed version in the build pipeline: It appears that due to API incompatibility there currently isn't a version of kubernetes-client with that bugfix that can be used with spring-cloud-kubernetes.

@ryanjbaxter
Copy link
Contributor

@wind57 is right this is a breaking change. I have opened a PR agains the Kubernetes Java client to upgrade the version of GSON so it is compatible with the version we are currently using. Hopefully they are willing to make the change and do a release.
kubernetes-client/java#1659

@xcq1 I am not sure how this is related

@xcq1
Copy link

xcq1 commented Dec 5, 2024

@ryanjbaxter Upgrading the kubernetes-client version like suggested in this PR would resolve that problem as well. If you prefer, I can open a detailed issue.

@ryanjbaxter
Copy link
Contributor

Unfortunately we can't upgrade in a minor release, we have to wait for a major. The best solution is to backport whatever fix was made in the kubernetes java client to the 19-release branch and have a release done. Seems like this is the fix that needs to be backported?
kubernetes-client/java#2952

@xcq1
Copy link

xcq1 commented Dec 5, 2024

Sorry, I am unfamiliar with Spring cloud's exact release cycles, I just wanted to point out the general need. I assume the next major version is a longer time away, in that case a backport of the fix would be well appreciated.

@ryanjbaxter
Copy link
Contributor

@xcq1 Can you open a separate issue for this and include the fix in the Kubernetes Java Client that needs to be backported? I can submit a PR with that fix to the correct branch and hopefully get a release from them that we can then use in our next release of Spring Cloud Kubernetes.

@xcq1
Copy link

xcq1 commented Dec 6, 2024

So while trying to make a minimal sample for my problem, I discovered I can completely remove any manual registration call to ModelMapper which makes the error go away and everything still works. With that I don't see a need for an additional backport. Sorry for the noise, it was just one of those days. Thanks anyway.

@ryanjbaxter
Copy link
Contributor

@desiderantes @xcq1 the issues you have identified with the Kubernetes Java client should he addressed in the 19.0.2 release. I have upgraded the dependency version in Spring Cloud Kuberentes and our next release of 2023.0.x and 2024.0.x should include this latest release.

@ryanjbaxter ryanjbaxter closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants