<p>Use case: I have values.yaml where I have a field <code>mode</code>.</p>
<p>Values.yaml</p>
<pre><code>mode: start
</code></pre>
<p>or user can enter a value for the field <code>mode</code> in any of the below mentioned ways:</p>
<pre><code>mode: STart or START or sTart
</code></pre>
<p>Now, I have a file where I am using an if condition as shown below:</p>
<pre><code>command: {{ if eq .Values.mode &quot;start&quot; }} do this {{ esle }} do that {{ end }}
</code></pre>
<p>Now, my challenge is how can I covert the &quot;.Values.mode&quot; into lower alphabets before doing the comparison. I have tried the below mentioned ways:</p>
<p>1.</p>
<pre><code>{{ if eq .Values.mode | lower &quot;start&quot; }} do this {{ esle }} do that {{ end }}
</code></pre>
<ol start="2">
<li></li>
</ol>
<pre><code>{{ if eq lower .Values.mode &quot;start&quot; }} do this {{ esle }} do that {{ end }}
</code></pre>
<p>Both of the above methods errored out.</p>
<p>Note: we are using a third-party tool, hence JSON schema check won't help me.</p>

<p><a href="https://helm.sh/docs/chart_template_guide/function_list/#lower" rel="noreferrer"><code>lower</code></a> is a function handed to you in the templates. It has a return value, which you wish to compare to another value.</p>
<p>Simply group the function call of <code>lower</code> with parenthesis:</p>
<pre><code>{{ if eq &quot;start&quot; (lower .Values.mode) }} do this {{ else }} do that {{ end }}
</code></pre>
