Skip to content
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

Builder methods expecting HasMetadata/KubernetesResource are not correct #4540

Closed
shawkins opened this issue Oct 27, 2022 · 2 comments · Fixed by #4615
Closed

Builder methods expecting HasMetadata/KubernetesResource are not correct #4540

shawkins opened this issue Oct 27, 2022 · 2 comments · Fixed by #4615
Assignees
Milestone

Comments

@shawkins
Copy link
Contributor

When the builder logic generates the handling for a method like IngressControllerSpec.unsupportedProperties it creates a method impl for withUnsupportedProperties that does an instanceOf check for the known buildable types. If you use something like GenericKubernetesResource, or RawExtension that is not an explicitly known type - it is silently ignored. At the very least an exception should be thrown.

For usability at a minimum we need to add GenericKubernetesResource and RawExtension as buildable everywhere - with either a method added or a pointer from the exception when an unknown type is used about converting to these types - either wrapping with RawExtension, or using Serialization.jsonMapper().convertValue(resource, GenericKubernetesResource.class).

cc @iocanel @manusa

@iocanel
Copy link
Member

iocanel commented Oct 27, 2022

The first part needs to be addressed in sundrio.

For the second part I need to refresh my memory as I don't recall by heart how GenericKubernetesResource and RawExtension work.

@shawkins shawkins added this to the 6.x milestone Oct 27, 2022
@shawkins
Copy link
Contributor Author

@iocanel do you want me to copy the first part over to sundrio?

@shawkins shawkins modified the milestones: 6.x, 6.3.0 Nov 28, 2022
@shawkins shawkins self-assigned this Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Nov 28, 2022
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants