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

HasMetadataOperation createVisitableBuilder #3284

Closed
shawkins opened this issue Jun 29, 2021 · 3 comments
Closed

HasMetadataOperation createVisitableBuilder #3284

shawkins opened this issue Jun 29, 2021 · 3 comments
Assignees

Comments

@shawkins
Copy link
Contributor

I added that method for edit operations - but I can see that it's possibly not needed given we should be able to lookup the Handler does that seem reasonable? Related to this there are apiVersion members/methods on both BaseOperation and HasMetadataOperation - should those be consolidated?

I'm also thinking it may not be a good idea to use the builder for cloning - just in case there are issues, like the one seen with CustomResource cloning, that would lead to really subtle bugs.

@rohanKanojia @manusa WDYT?

@manusa
Copy link
Member

manusa commented Jun 30, 2021

Context #3070

@manusa
Copy link
Member

manusa commented Jun 30, 2021

I added that method for edit operations

I'm a little bit lost here.

Related to this there are apiVersion members/methods on both BaseOperation and HasMetadataOperation - should those be consolidated?

I only see the apiVersion member in BaseOperation:

I can't find that in the HasMetadataOperation class. Maybe you are referring to the static methods in the HasMetadata class? If this is the case, I don't think they can be consolidated. However, I'm a bit confused about the purpose of that field.

I'm also thinking it may not be a good idea to use the builder for cloning

I think that, although it's a costly operation, we should probably use a serialize/deserialize (or convert to Map/Array+Map and back via Jackson) to stay on the safe side and avoid side-effects.

@shawkins
Copy link
Contributor Author

I'm a little bit lost here.

protected VisitableBuilder<T, ?> createVisitableBuilder(T item) {

Used in

return patch(null, clone, createVisitableBuilder(item).accept(visitors).build(), false);

and

It sounds like we're in agreement to remove that latter usage.

In looking at replacing the create method with handler logic, I see

(above I mistakenly said HasMetadataOperation).

It appears to mean just the version.

and

That one only appears to be set by CustomResourceOperationsImpl and means the group + version.

shawkins added a commit to shawkins/kubernetes-client that referenced this issue Jul 1, 2021
also just using serialization for cloning
shawkins added a commit to shawkins/kubernetes-client that referenced this issue Jul 1, 2021
also just using serialization for cloning
@manusa manusa closed this as completed in 3f221e1 Jul 9, 2021
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

No branches or pull requests

2 participants