<p>I am setting some properties in configmap on basis of some flags' values. To achieve this I am using "if/else" conditions in my configmap.yaml. But these "if" conditions are working fine if there is only one expression inside "if" block but for multiple expression clubbed with "or" and "and" is being evaluated incorrectly.</p>

<p><strong>configmap.yaml:</strong></p>

<pre><code>{{- else if (eq .Values.A "oracle") and (eq .Values.B "true") or (eq .Values.A "postgresql") }}
</code></pre>

<p>The above condition is being evaluated to false however it was supposed to be evaluated as true because the last condition is true. </p>

<pre><code>MYPROP1 = {{ (eq .Values.A"oracle") and (eq .Values.B "true") or (eq .Values.databaseType "postgresql") }} ==&gt;printing false
    MYPROP2 = {{ (eq .Values.A"oracle") and (eq .Values.B "true") }} ==&gt;printing false
    MYPROP3 = {{ (eq .Values.A"postgresql") }} ===&gt; printing true
</code></pre>

<p>The expression is evaluated left to right and will exited as as soon as the <code>and</code> operator is evaluated as <code>false</code>. The <code>or</code> expression will never be evaluated. </p>

<p>You can achieve your expected behaviour when you use parenthesis: </p>

<pre><code>((eq .Values.A "oracle") and (eq .Values.B "true")) or (eq .Values.A "postgresql")
</code></pre>
