func overwrite(dst, src reflect.Value) error {
	if !src.IsZero() {
		if dst.CanSet() {
			dst.Set(src)
		} else {
			dst = src
		}
	}
	return nil
}
overwrite just overrites the dst value with the source.
nolint: unparam
package transformers
import (
	"errors"
	"reflect"
	"github.com/imdario/mergo"
	corev1 "k8s.io/api/core/v1"
)
type TransformerMap map[reflect.Type]func(dst, src reflect.Value) error
var PodSpec TransformerMap
var errCannotMerge = errors.New("cannot merge when key type differs")
func init() {  
	PodSpec = TransformerMap{
		reflect.TypeOf([]corev1.Container{}):            PodSpec.MergeListByKey("Name", mergo.WithOverride),
		reflect.TypeOf([]corev1.ContainerPort{}):        PodSpec.MergeListByKey("ContainerPort", mergo.WithOverride),
		reflect.TypeOf([]corev1.EnvVar{}):               PodSpec.MergeListByKey("Name", mergo.WithOverride),
		reflect.TypeOf(corev1.EnvVar{}):                 PodSpec.OverrideFields("Value", "ValueFrom"),
		reflect.TypeOf(corev1.VolumeSource{}):           PodSpec.NilOtherFields(),
		reflect.TypeOf([]corev1.Toleration{}):           PodSpec.MergeListByKey("Key", mergo.WithOverride),
		reflect.TypeOf([]corev1.Volume{}):               PodSpec.MergeListByKey("Name", mergo.WithOverride),
		reflect.TypeOf([]corev1.LocalObjectReference{}): PodSpec.MergeListByKey("Name", mergo.WithOverride),
		reflect.TypeOf([]corev1.HostAlias{}):            PodSpec.MergeListByKey("IP", mergo.WithOverride),
		reflect.TypeOf([]corev1.VolumeMount{}):          PodSpec.MergeListByKey("MountPath", mergo.WithOverride),
		reflect.TypeOf(corev1.Affinity{}):               PodSpec.OverrideFields("NodeAffinity", "PodAffinity", "PodAntiAffinity"),
		reflect.TypeOf(""):                              overwrite,
		reflect.TypeOf(new(string)):                     overwrite,
		reflect.TypeOf(new(int32)):                      overwrite,
		reflect.TypeOf(new(int64)):                      overwrite,
		reflect.TypeOf(corev1.ResourceList{}):           overwrite,
	}
}