kubernetes-client
kubernetes-client copied to clipboard
Rationalize KubernetesList/BaseKubernetesList/DefaultKubernetesResourceList
Is your task related to a problem? Please describe
These classes after #3628 there are further cleanups that can be made to several list classes.
Describe the solution you'd like
- BaseKubernetesList could can be merged with KubernetesList (this would mean changing/moving the generated class to be KubernetesList).
- ~~KubernetesList should implement KubernetesResourceList.~~ - it already does
- DefaultKubernetesResourceList and CustomResourceList would then be deprecated and indicate to use KubernetesList instead.
Describe alternatives you've considered
No response
Additional context
No response
Ideal state is:
- deprecate/remove: DefaultKubernetesResourceList, CustomResourceList, and KubernetesResourceList
- BaseKubernetesList becomes generic (and thus a replacement for CustomResourceList and DefaultKubernetesResourceList) and the generation logic is changed to make each resource list extend BaseKubernetesList
- KubernetesList can still be used in the api where appropriate - if BaseKubernetesList<HasMetadata> is possible, you could even just rename BaseKubernetesList to KubernetesList to eliminate one more class.
Since the generation logic seems more involved that I want to mess with, that means we need to keep KubernetesResourceList as the resource lists will not have a common base with the other lists.
From there no matter what I try if I have a generic BaseKubernetesList something fails with the buildable logic with KubernetesList - if BaseKubernetesList is not buildable, the KubernetesListFluent isn't aware of the necessary fields. If BaseKubernetesList is buildable, I get:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.0:compile (default-compile) on project kubernetes-model-core: Fatal error compiling: java.lang.ClassCastException: class io.sundr.model.TypeParamRef cannot be cast to class io.sundr.model.ClassRef (io.sundr.model.TypeParamRef and io.sundr.model.ClassRef are in unnamed module of loader java.net.URLClassLoader @6921cfa)
So I think that means the I'm stuck. If we want to retain a KubernetesList builder, then we cannot improve on the current set of classes other than to deprecate CustomResourceList
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
Shall we go ahead with the CustomResourceList deprecation?
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!