<p>I have a property file in chart/properties folder. For example <strong>chart/properties/dev</strong> is the file
and the contents of it looks like the below</p>
<pre><code>var1=somevalue1
var2=somevalue2


var3=somepwd=

var4=http://someurl.company.com

</code></pre>
<p>some of the value strings in property file have an =. There are also some empty lines in the property file.</p>
<p>and <strong>chart/configmap.yaml</strong> looks like below</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: env-configmap
  namespace: {{ .Release.Namespace }}
data:
{{ range .Files.Lines &quot;properties&quot;/.Values.env.required.environment }}
  {{ . | replace &quot;=&quot; &quot;: &quot; }}
{{ end }}
</code></pre>
<p><strong>Generated yaml file:</strong></p>
<pre><code>---
# Source: app/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: env-configmap
  namespace: default
data:

  var1: somevalue1

  var2: somevalue2
  
  var3: somepwd:

  var4: http://someurl.company.com
</code></pre>
<p>The generated output property entries are missing double quote in the value, as a result deployment complains of it when the value strings contain special characters.</p>
<p>I'm expecting the configmap.yaml data block to be a proper yaml (Indent 2) like file with the above changes. With above changes, there are extra lines after each property entry in yaml file. I got this to work partially when there are no blank lines and no value strings with =. Need help to get this working correctly.</p>
<p><strong>Expected yaml file:</strong></p>
<pre><code>---
# Source: app/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: env-configmap
  namespace: default
data:
  var1: &quot;somevalue1&quot;
  var2: &quot;somevalue2&quot;
  var3: &quot;somepwd=&quot;
  var4: &quot;http://someurl.company.com&quot;
</code></pre>

Hafeez
<p>You can follow go template syntax to do that. I update config.yaml like following works</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: env-configmap
  namespace: {{ .Release.Namespace }}
data:
  {{ range .Files.Lines &quot;properties&quot;/.Values.env.required.environment }}
    {{- if ne . &quot;&quot; -}}
    {{- $parts := splitn &quot;=&quot; 2 . -}} # details about split function http://masterminds.github.io/sprig/string_slice.html
    {{ $parts._0 }}: {{ $parts._1 | quote }}
    {{end}}
  {{ end }}
</code></pre>
