kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

fix: Stack overflow on multi maps (and other non-trivial generic classes)

Open xRodney opened this issue 3 years ago • 1 comments

Description

Logic in sundrio that is responsible for replacing generic type arguments on methods and properties with their concrete instantiations from subclasses contained a bug, in which it looped infinitely if the same type argument name was used at multiple classes in the hierarchy. A common occurence were multimaps.

A very similar code was also present in crd-generator, also suffering from the same bug.

Sundrio has been updated to account for this situation, and updated utilities from sundrio have been introduced to crd-generator, which replace the previous implementation of teh same algorithm.

Fixes fabric8io/kubernetes-client#4357

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] Feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change
  • [ ] Chore (non-breaking change which doesn't affect codebase; test, version modification, documentation, etc.)

Checklist

  • [x] Code contributed by me aligns with current project license: Apache 2.0
  • [x] I Added CHANGELOG entry regarding this change
  • [x] I have implemented unit tests to cover my changes
  • [ ] I have added/updated the javadocs and other documentation accordingly
  • [ ] No new bugs, code smells, etc. in SonarCloud report
  • [ ] I tested my code in Kubernetes
  • [ ] I tested my code in OpenShift

xRodney avatar Sep 13 '22 09:09 xRodney

TODO: wait for a new release of sundrio by @iocanel, then update version in pom.xml

xRodney avatar Sep 13 '22 09:09 xRodney

Superseded by fabric8io/kubernetes-client#4501. The next release of sundrio 0.93.1 contains not only the original fix for stack overflow, but also additional work to fully support multimaps and generate correct schema for them.

xRodney avatar Oct 14 '22 14:10 xRodney