{{- if .Values.manifests.storageclass }}
{{- $envAll := . }}
{{- range $val := $envAll.Values.conf.fake_mounts.classes }}
{{- if $val.storageClass }}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: {{ $val.name }}
  {{- if kindIs "map" $val.storageClass }}
  {{- if $val.storageClass.isDefaultClass }}
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  {{- end }}
  {{- end }}
  labels:
{{ tuple $envAll $envAll.Chart.Name "storageclass" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
{{- if kindIs "map" $val.storageClass }}
reclaimPolicy: {{ $val.storageClass.reclaimPolicy | default "Delete" }}
{{- else }}
reclaimPolicy: Delete
{{- end }}
{{- end }}
{{- end }}
{{- end }}
