{{ if .Values.storageClass.create -}}
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: {{ .Values.storageClass.name }}
  labels:
    app: {{ template "nfs-provisioner.name" . }}
    chart: {{ template "nfs-provisioner.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  {{- if .Values.storageClass.defaultClass }}
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  {{- end }}
provisioner: {{ template "nfs-provisioner.provisionerName" . }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
{{ if .Values.storageClass.allowVolumeExpansion }}
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
{{ end }}
{{- with .Values.storageClass.parameters }}
parameters:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.storageClass.mountOptions }}
mountOptions:
{{- toYaml . | nindent 2 }}
{{- end }}
{{ end -}}
