istio-client-go
istio-client-go copied to clipboard
Implement correct DeepCopyInto methods for Istio API struct types
The generated Go structs for Istio API resources are missing the DeepCopyInto
methods which are needed by k8s codegen to generate client code.
A poor man's version of DeepCopyInto
has been implemented in this repository like this which is more of a shallow copy than deep copy.
This might cause issues related to corruption in future.
I noticed this issue when I try to use it in my project. The istio CRD definition contain interfaces and I wonder how to implement deep copy for them?
What will happen if we use current shallow copy version?
If you’re just using this package to get resources and not mutate them then you don’t need to worry about deep or shallow copy.
If you plan to copy items from the informer cache and mutate them, then using shallow copy might cause inconsistency as you end up having two entities updating the same resource.
For enabling this functionality automatically, istio’s generated go files from proto need to add the annotations for deepcopy
for all relevant structure and generate deepcopy
if any need special handling.