@@ -14,15 +14,15 @@ import (
14
14
// MergeEnvVars merges one slice of corev1.EnvVar into another slice of corev1.EnvVar
15
15
// if overwriteValues is false, this function will return an error if a duplicate EnvVar name is encountered
16
16
// if overwriteValues is true, this function will overwrite the existing value with the new value if a duplicate is encountered
17
- func MergeEnvVars (new []corev1.EnvVar , into []corev1.EnvVar , overwriteValues bool ) ([]corev1.EnvVar , error ) {
18
- // if new , into, or both are empty, there is no need to run through the processing logic
17
+ func MergeEnvVars (from []corev1.EnvVar , into []corev1.EnvVar , overwriteValues bool ) ([]corev1.EnvVar , error ) {
18
+ // if from , into, or both are empty, there is no need to run through the processing logic
19
19
// just quickly return the appropriate value
20
- if len (new ) == 0 && len (into ) == 0 {
20
+ if len (from ) == 0 && len (into ) == 0 {
21
21
return []corev1.EnvVar {}, nil
22
- } else if len (new ) == 0 {
22
+ } else if len (from ) == 0 {
23
23
return into , nil
24
24
} else if len (into ) == 0 {
25
- return new , nil
25
+ return from , nil
26
26
}
27
27
28
28
// create a map of the original (into) env vars with the name as the key and
@@ -38,7 +38,7 @@ func MergeEnvVars(new []corev1.EnvVar, into []corev1.EnvVar, overwriteValues boo
38
38
39
39
// merge the new env vars into the original env vars list following a few simple rules
40
40
// based on if the name already exists and whether overwriteValues is true or false
41
- for _ , n := range new {
41
+ for _ , n := range from {
42
42
_ , exists := originalEnvs [n .Name ]
43
43
44
44
switch {
0 commit comments