func EnvMerge(existing []corev1.EnvVar, merge []corev1.EnvVar, override bool) []corev1.EnvVar {
	ret := []corev1.EnvVar{}
	final := map[string]corev1.EnvVar{}
	for _, e := range existing {
		final[e.Name] = e
	}
	for _, m := range merge {
		if _, ok := final[m.Name]; ok {
			if override {
				final[m.Name] = m
			}
		} else {
			final[m.Name] = m
		}
	}
	for _, v := range final {
		ret = append(ret, v)
	}
	return ret
}
EnvMerge merges two slices of EnvVar entries into a single one. If existing
has an EnvVar with same Name attribute as one in merge, the EnvVar is not
merged unless override is set to true. The resulting slice is not guaranteed
to be in the same order than the existing input.
package argoutil
import (
	corev1 "k8s.io/api/core/v1"
)