mlab-lattice / lattice

Apache License 2.0
1 stars 3 forks source link

properly implement DeepCopyInto for types living outside of pkg/backend/kubernetes/api/customresources/apis/lattice/v1 #224

Closed kevindrosendahl closed 5 years ago

kevindrosendahl commented 5 years ago

currently, we're simply using pointer dereferences to copy types not living in the v1 package, such as: https://github.com/mlab-lattice/lattice/blob/216-latticectl-overhaul/pkg/backend/kubernetes/customresource/apis/lattice/v1/deepcopy.go#L21

an issue with this is that if any of these structs contain pointer fields (which they do) we don't recurse on the pointers, instead the new struct will have the same pointers.

this nullifies some of the point of copying the objects in controllers as not to mutate the cached versions held in the informers

kevindrosendahl commented 5 years ago

fixed in https://github.com/mlab-lattice/lattice/pull/240