{{- if .Values.dataintegration.enabled }}
---
{{- if not .Values.dataintegration.persistence.existentPvc.enabled }}
{{- if .Values.dataintegration.persistence.enabled }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "cmem.name-di" . }}-data
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "cmem.labels-di" . | nindent 4 }}
spec:
  storageClassName: {{ .Values.dataintegration.persistence.storageClassName }}
  resources:
    requests:
      storage: {{ .Values.dataintegration.persistence.storageSize }}
  accessModes:
    - ReadWriteOnce
{{- end }}
{{- end }}
{{- if not .Values.dataintegration.cache.existentPvc.enabled }}
{{- if .Values.dataintegration.cache.pvcenabled }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "cmem.name-di" . }}-cache
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "cmem.labels-di" . | nindent 4 }}
spec:
  storageClassName: {{ .Values.dataintegration.cache.storageClassName }}
  resources:
    requests:
      storage: {{ .Values.dataintegration.cache.cacheSize }}
  accessModes:
    - ReadWriteOnce
{{- end }}
{{- end }}
{{- if .Values.dataintegration.tmp.pvcenabled }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ template "cmem.name-di" . }}-tmp
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "cmem.labels-di" . | nindent 4 }}
spec:
  storageClassName: {{ .Values.dataintegration.tmp.storageClassName }}
  resources:
    requests:
      storage: {{ .Values.dataintegration.tmp.cacheSize }}
  accessModes:
    - ReadWriteOnce
{{- end }}
---
{{- end }}
