Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	pkg/processor/deployment/deployment.go
  • Loading branch information
arttor committed Mar 9, 2023
2 parents d9adc44 + 42f5649 commit 3b265bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions pkg/processor/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 3b265bd

Please sign in to comment.