<p>I have top level chart and one of the subcharts. In subchart I want to use variables that defined in level chart, and if it is not found - use default value.</p>

<p>I have code like this in one of deployment definitions in my subchart</p>

<pre><code>name: {{tpl .Values.global.my.GlobalValue .}}
</code></pre>

<p>where Values.global.my.GlobalValue - is parameter from top level chart. </p>

<p>Problem is when I try to install only subchart - I am failing, I need some defaults. </p>

<p>I tried to puth like below and it is not working</p>

<pre><code>name: {{default defaultName tpl .Values.global.my.GlobalValue .}}
name: {{tpl .Values.global.my.GlobalValue . | defaultName}}
</code></pre>

<p>Could you please advise the correct way to do that.</p>

<p>As per <a href="https://helm.sh/docs/chart_template_guide/#using-the-default-function" rel="nofollow noreferrer">Using the default function</a>:</p>

<blockquote>
  <p>One function frequently used in templates is the <code>default</code> function:
  <code>default DEFAULT_VALUE GIVEN_VALUE</code>. This function allows you to specify
  a default value inside of the template, in case the value is omitted.</p>
</blockquote>

<p>You should use:</p>

<p><code>name: {{ .Values.global.my.GlobalValue | default "defaultName" | quote }}</code></p>
