-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raw handling #4289
Comments
Primarily the KubernetesResource interface exists to associate the KubernetesDeserializer annotation. We could just as easily associated that directly with the generated model classes, rather then using a base / marker interface. Before we more generally use the KubernetesResource interface, there is some question about generally should be a "resource" - if it really is just synonymous with HasMetadata as all base kubernetes resources are, or if should also represent the openshift "resources" that are typically not even restful, which lack metadata. This includes request objects like LocalResourceAccessReview and their respective responses. |
There is also io.fabric8.openshift.api.model.runtime.RawExtension in the mix, which matches what was mentioned above about a specific Raw type. Here's a refined proposal:
This will break a few things:
There's not a great way to add more convenience that won't break other usage patterns. |
As a major breaking change, in a future major release (7.x) all of the classes that currently implement |
With #4289 committed the only follow on I can think to consider is if RawExtension is added as a buildable target (either to all or selectively to classes using a relevant mapping), that would allow for methods like:
vs
That provides a better hint about how to create a raw KubernetesResources, but otherwise don't save the user much typing / mental load. |
Is your enhancement related to a problem? Please describe
The mapping of raw values is inconsistent, and leads to other issues such as the loss of non-HasMetadata values when parsing as noted on #4263 and the need to use an unmatched type handlers for templates - #4034 as the objects are actually typed as raw.
A possible semantic issue - KubernetesResource is a root interface that could server for both typed and untyped values. However GenericKuberentesResource is actually a HasMetada. Since it's optional HasMetadata aspect is optional there's a case to be made that GenericKuberentesResource could be used in general for raw.
Describe the solution you'd like
Something consistent :) But to do that there will be a breaking change.
The best option is probably to always use KuberenetesResource as the mapping. There are still some issues:
This will not address how sundrio chooses what subtypes to add to the builder methods - it will still only add those resources that are part of the module or in the buildable references.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: