<p>I'm working with a chart that has the following structure at the beginning but I'm having a hard time understanding when does this evaluate to true.</p>
<pre><code>{{- if and .Values.vpceIngress.enabled .Values.http.paths (ne .Values.vpceIngress.class &quot;traefik2&quot;) }}
</code></pre>
<p>I believe that both <code>enabled</code> and <code>paths</code> must be true, but the <code>ne</code> throws me off after that.</p>

<p><code>and</code> and <code>ne</code> are functions in <a href="https://golang.org/pkg/text/template/" rel="noreferrer">go templates</a>.</p>
<pre><code>and
    Returns the boolean AND of its arguments by returning the
    first empty argument or the last argument, that is,
    &quot;and x y&quot; behaves as &quot;if x then y else x&quot;. All the
    arguments are evaluated.
</code></pre>
<pre><code>ne
    Returns the boolean truth of arg1 != arg2
</code></pre>
<p>So the template line equates to a more psuedo codish</p>
<pre><code>if (
  .Values.vpceIngress.enabled
  &amp;&amp; .Values.http.paths
  &amp;&amp; .Values.vpceIngress.class != &quot;traefik2&quot;
)
</code></pre>
<p>The truthiness of the plain <code>.Value.key</code> is basically a &quot;is this field/key <a href="https://www.geeksforgeeks.org/zero-value-in-golang/" rel="noreferrer">not the zero value for the data type</a>. This also works for maps as 'is this field/key defined' due to a map without that path equating to nil or non value (Note that this only works when the parent map is actually defined! Otherwise the template errors)</p>
