{{- if .Values.modelsStorage.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: finetuning-ms-models-pvc
spec:
  # We only want to set storageClassName when the user intentionally and explicitly specifies it in the values.
  # Otherwise, we don't want to set storageClassName at all, because it is an immutable field. It is much better
  # to just not set it, and let K8s leverage the default storage class.
  {{- if .Values.modelsStorage.storageClassName }}
  storageClassName: {{ .Values.modelsStorage.storageClassName }}
  {{- end }}
  accessModes:
    {{- .Values.modelsStorage.accessModes | toYaml | nindent 4 }}
  resources:
    requests:
      storage: {{ .Values.modelsStorage.size }}
{{- end }}
