title: Helm use default string when values is empty string
body: <p>While using Helm3, I want to set certain name as <code>(.Values.nameOverride)-init</code> when <code>.Values.nameOverride</code> is set, and set the name as &quot;init&quot; when <code>.Values.nameOverride</code> isn't set (Just defined as empty string). However, by using the expression below, default is never used.</p>
  <pre><code>name: {{ printf &quot;%s-init&quot; .Values.nameOverride | default &quot;init&quot; }}
  </code></pre>
  <p>I can achieve what I'm trying to achieve, by using more lines.</p>
  <pre><code>  {{- if .Values.nameOverride }}
    name: {{ .Values.nameOverride }}-init
    {{- else }}
    name: &quot;init&quot;
    {{- end }}
  </code></pre>
  <p>Is it possible to achieve the goal in a more simple way? I have to use this expression in multiple places, so I want to shorten the expression.</p>
  <p>Thank you!</p>