{{- if .Values.persistence.data.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "openclaw-mission-control.fullname" . }}-data
  labels:
    {{- include "openclaw-mission-control.labels" . | nindent 4 }}
  {{- with .Values.persistence.data.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  accessModes:
    - {{ .Values.persistence.data.accessMode }}
  {{- if .Values.persistence.data.storageClass }}
  storageClassName: {{ .Values.persistence.data.storageClass }}
  {{- end }}
  resources:
    requests:
      storage: {{ .Values.persistence.data.size }}
  {{- with .Values.persistence.data.selector }}
  selector:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- end }}
---
{{- if .Values.persistence.workspace.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "openclaw-mission-control.fullname" . }}-workspace
  labels:
    {{- include "openclaw-mission-control.labels" . | nindent 4 }}
  {{- with .Values.persistence.workspace.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  accessModes:
    - {{ .Values.persistence.workspace.accessMode }}
  {{- if .Values.persistence.workspace.storageClass }}
  storageClassName: {{ .Values.persistence.workspace.storageClass }}
  {{- end }}
  resources:
    requests:
      storage: {{ .Values.persistence.workspace.size }}
  {{- with .Values.persistence.workspace.selector }}
  selector:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- end }}
