{{- if .Values.sharedStorage.packs.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "attune.fullname" . }}-packs
  labels:
    {{- include "attune.labels" . | nindent 4 }}
spec:
  accessModes:
    {{- toYaml .Values.sharedStorage.packs.accessModes | nindent 4 }}
  resources:
    requests:
      storage: {{ .Values.sharedStorage.packs.size }}
  {{- if .Values.sharedStorage.packs.storageClassName }}
  storageClassName: {{ .Values.sharedStorage.packs.storageClassName }}
  {{- end }}
---
{{- end }}
{{- if .Values.sharedStorage.runtimeEnvs.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "attune.fullname" . }}-runtime-envs
  labels:
    {{- include "attune.labels" . | nindent 4 }}
spec:
  accessModes:
    {{- toYaml .Values.sharedStorage.runtimeEnvs.accessModes | nindent 4 }}
  resources:
    requests:
      storage: {{ .Values.sharedStorage.runtimeEnvs.size }}
  {{- if .Values.sharedStorage.runtimeEnvs.storageClassName }}
  storageClassName: {{ .Values.sharedStorage.runtimeEnvs.storageClassName }}
  {{- end }}
---
{{- end }}
{{- if .Values.sharedStorage.artifacts.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "attune.fullname" . }}-artifacts
  labels:
    {{- include "attune.labels" . | nindent 4 }}
spec:
  accessModes:
    {{- toYaml .Values.sharedStorage.artifacts.accessModes | nindent 4 }}
  resources:
    requests:
      storage: {{ .Values.sharedStorage.artifacts.size }}
  {{- if .Values.sharedStorage.artifacts.storageClassName }}
  storageClassName: {{ .Values.sharedStorage.artifacts.storageClassName }}
  {{- end }}
{{- end }}
