<p>Here my <code>templates/deployment.yaml</code> snippet code:</p>

<pre><code>volumes:
  - name: notebooks
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdf"
  {{- else }}
    emptyDir: {}
  {{- end -}}
  - name: logs
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdfdsf"
  {{- else }}
    emptyDir: {}
  {{- end -}}
  - name: conf
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdfsdfsdfsd"
  {{- else }}
    emptyDir: {}
  {{- end -}}
</code></pre>

<p>Currently, I'm getting:</p>

<pre><code>&amp; helm template zeppelin ./
Error: YAML parse error on zeppelin/templates/deployment.yaml: error converting YAML to JSON: yaml: line 95: block sequence entries are not allowed in this context
</code></pre>

<p>It's getting me:</p>

<blockquote>
  <p>block sequence entries are not allowed in this context</p>
</blockquote>

<p>I've tried to clean a bit up the code:</p>

<pre><code>  volumes:
    - name: notebooks
      persistentVolumeClaim:
        claimName: "sdfsdf"
    - name: logs
      persistentVolumeClaim:
        claimName: "sdfsdfdsf"
    - name: conf
      persistentVolumeClaim:
        claimName: "sdfsdfsdfsdfsd"
</code></pre>

<p>It's rendered coorectly.</p>

<p>What's wrong on <code>if</code> statements?</p>

Jordi
<p>You have some extra trims in your if/else statements that break the yaml structure.</p>

<p>Working example:</p>

<pre><code>volumes:
  - name: notebooks
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdf"
  {{- else }}
    emptyDir: {}
  {{- end }}
  - name: logs
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdfdsf"
  {{- else }}
    emptyDir: {}
  {{- end }}
  - name: conf
  {{- if .Values.persistence.enabled }}
    persistentVolumeClaim:
      claimName: "sdfsdfsdfsdfsd"
  {{- else }}
    emptyDir: {}
  {{- end }}
</code></pre>

<p>More info about <a href="https://helm.sh/docs/chart_template_guide/control_structures/#controlling-whitespace" rel="noreferrer">controlling whitespace here</a></p>
