-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Save a DeepCopy when patching typed objects #3628
🌱 Save a DeepCopy when patching typed objects #3628
Conversation
/assign @ncdc |
When using the patch helper to patch objects, we perform lots of DeepCopy for safety purposes. After giving a closer look, it seems we can definitely save one deep copy when the patch helper is created and when Patch() is invoked by checking if the incoming object is unstructured or not. The deep copy was previously performed because the unstructured coverter in the runtime package returns the inner map of an unstructured object instead of making it a copy (this isn't a bug, it's how it's meant to be used). Signed-off-by: Vince Prignano <[email protected]>
88169e5
to
45de611
Compare
/lgtm |
Once this merges, I'll add tests for in the #3630 to avoid rebasing :P |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-cluster-api-test |
When using the patch helper to patch objects, we perform lots of
DeepCopy for safety purposes. After giving a closer look, it seems we
can definitely save one deep copy when the patch helper is created and
when Patch() is invoked by checking if the incoming object is
unstructured or not.
The deep copy was previously performed because the unstructured coverter
in the runtime package returns the inner map of an unstructured object
instead of making it a copy (this isn't a bug, it's how it's meant to be
used).
Signed-off-by: Vince Prignano [email protected]
/milestone v0.3.10