title: How do I use toyaml with a default empty/null value?
body: <p>I really want to avoid an &quot;if&quot; condition because this feels like something that could be handled in a more readable way.</p>
  <p>I have a value like this:</p>
  <pre><code>healthChecks:
    livenessProbe:
      httpGet:
        path: /
        port: http
  </code></pre>
  <p>And use it like this:</p>
  <pre><code>{{- toYaml .Values.healthChecks | nindent 10 }}
  </code></pre>
  <p>But the value might be empty and I want to support that. So if the value <code>healthChecks:</code> isn't specified the chart doesn't render it. How do I do this?</p>
  <p>I was hoping toYaml would be smart enough to see .Values.healthChecks is empty and not do anything but it throws an error: <code>unable to parse YAML: error converting YAML to JSON: yaml: line X: could not find expected ':'</code></p>
  <p>Do I seriously need an if condition for this? Is there a built in way to just have toYaml do nothing if a value is empty?</p>