diff --git a/examples/operator/templates/deployment.yaml b/examples/operator/templates/deployment.yaml index 055ea79..cda4bfa 100644 --- a/examples/operator/templates/deployment.yaml +++ b/examples/operator/templates/deployment.yaml @@ -53,9 +53,9 @@ spec: key: VAR1 name: {{ include "operator.fullname" . }}-secret-vars - name: VAR2 - value: {{ .Values.controllerManager.manager.var2 }} + value: {{ .Values.controllerManager.manager.env.var2 }} - name: VAR3_MY_ENV - value: {{ .Values.controllerManager.manager.var3MyEnv }} + value: {{ .Values.controllerManager.manager.env.var3MyEnv }} - name: VAR4 valueFrom: configMapKeyRef: diff --git a/pkg/processor/deployment/deployment.go b/pkg/processor/deployment/deployment.go index c376ad7..4a4daa6 100644 --- a/pkg/processor/deployment/deployment.go +++ b/pkg/processor/deployment/deployment.go @@ -48,7 +48,8 @@ const selectorTempl = `%[1]s %[3]s` const imagePullPolicyTemplate = "{{ .Values.%[1]s.%[2]s.imagePullPolicy }}" -const envValue = "{{ .Values.%[1]s.%[2]s.%[3]s }}" +const envValue = "{{ .Values.%[1]s.%[2]s.%[3]s.%[4]s }}" + // New creates processor for k8s Deployment resource. func New() helmify.Processor { @@ -308,7 +309,7 @@ func processEnv(name string, appMeta helmify.AppMetadata, c corev1.Container, va if err != nil { return c, errors.Wrap(err, "unable to set deployment value field") } - c.Env[i].Value = fmt.Sprintf(envValue, name, containerName, strcase.ToLowerCamel(strings.ToLower(c.Env[i].Name))) + c.Env[i].Value = fmt.Sprintf(envValue, name, containerName, "env", strcase.ToLowerCamel(strings.ToLower(c.Env[i].Name))) } return c, nil }