types: Fix the missing deepcopy for engineSpec.UpgradedReplicaAddressMap
Any type of reference variable needs to be deep copied, including map and list.
@@ -13,14 +13,19 @@ func (v *VolumeSpec) DeepCopyInto(to *VolumeSpec) {
func (e *EngineSpec) DeepCopyInto(to *EngineSpec) {
*to = *e
- if e.ReplicaAddressMap == nil {
- return
- }
+ if e.ReplicaAddressMap != nil {
to.ReplicaAddressMap = make(map[string]string)
for key, value := range e.ReplicaAddressMap {
to.ReplicaAddressMap[key] = value
}
}
+ if e.UpgradedReplicaAddressMap != nil {
+ to.UpgradedReplicaAddressMap = make(map[string]string)
+ for key, value := range e.UpgradedReplicaAddressMap {
+ to.UpgradedReplicaAddressMap[key] = value
+ }
+ }
+}
func (e *EngineStatus) DeepCopyInto(to *EngineStatus) {
*to = *e
