这是我的templates/deployment.yaml
代码段:
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 -}}
目前,我得到:
& 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
它让我:
在此上下文中不允许块序列条目
我试图清理一下代码:
volumes:
- name: notebooks
persistentVolumeClaim:
claimName: "sdfsdf"
- name: logs
persistentVolumeClaim:
claimName: "sdfsdfdsf"
- name: conf
persistentVolumeClaim:
claimName: "sdfsdfsdfsdfsd"
它的渲染是正确的。
if
陈述有什么问题?