Skip to content

Commit

Permalink
always use quotes for env values
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored and arttor committed Mar 14, 2023
1 parent db73ef4 commit 55d9c9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/processor/daemonset/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Cont
}
c.Env = append(c.Env, corev1.EnvVar{
Name: cluster.DomainEnv,
Value: fmt.Sprintf("{{ .Values.%s }}", cluster.DomainKey),
Value: fmt.Sprintf("{{ quote .Values.%s }}", cluster.DomainKey),
})
for k, v := range c.Resources.Requests {
err = unstructured.SetNestedField(*values, v.ToUnstructured(), name, containerName, "resources", "requests", k.String())
Expand Down
4 changes: 2 additions & 2 deletions pkg/processor/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const selectorTempl = `%[1]s
%[3]s`

const imagePullPolicyTemplate = "{{ .Values.%[1]s.%[2]s.imagePullPolicy }}"
const envValue = "{{ .Values.%[1]s.%[2]s.%[3]s.%[4]s }}"
const envValue = "{{ quote .Values.%[1]s.%[2]s.%[3]s.%[4]s }}"

// New creates processor for k8s Deployment resource.
func New() helmify.Processor {
Expand Down Expand Up @@ -276,7 +276,7 @@ func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Cont
}
c.Env = append(c.Env, corev1.EnvVar{
Name: cluster.DomainEnv,
Value: fmt.Sprintf("{{ .Values.%s }}", cluster.DomainKey),
Value: fmt.Sprintf("{{ quote .Values.%s }}", cluster.DomainKey),
})
for k, v := range c.Resources.Requests {
err = unstructured.SetNestedField(*values, v.ToUnstructured(), name, containerName, "resources", "requests", k.String())
Expand Down

0 comments on commit 55d9c9d

Please sign in to comment.