我正在尝试创建一个条件块来创建PVC或emptyDir。 当我将值设置为true时,它可以按预期工作,但是当使用false时,出现以下错误: 未找到预期的'-'指示器
yaml文件:
volumeMounts:
- name: rabbitmq-data
mountPath: /etc/rabbitmq/config
readOnly: false
- name: mq-tls
mountPath: /etc/rabbitmq/certfiles
- name: data
mountPath: /var/lib/rabbitmq/mnesia
volumes:
- name: data
{{- if .Values.global.rabbitmq.persistence.enabled }}
persistentVolumeClaim:
claimName: rabbitmq-pv-claim
{{- else }}
emptyDir: {}
{{- end }}
- name: mq-tls
secret:
secretName: rabbitmq-secrets
defaultMode: 420
- configMap:
name: mq-config
defaultMode: 420
items:
- key: rabbitmq.config
path: rabbitmq.config
- key: definitions.json
path: definitions.json
name: rabbitmq-data
values.yaml文件:
rabbitmq:
persistence:
enabled: false