Skip to content

Should we use DeepCopy() to update Spec? #2804

Closed Answered by FillZpp
hatrena asked this question in Support
Discussion options

You must be logged in to vote

This is not necessary. Only note that both Update and Patch methods will overwrite the new object returned from APIServer into the given object, which means the objToUpdate will be changed to the latest object after patched successfully.

So, you should DeepCopy it only if you don't want the original object to be modified.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@hatrena
Comment options

Answer selected by hatrena
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
3 participants