{{ if .Values.smbVolume.enabled }}

apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ include "smb-flexvol.fullname" . }}
  labels:
{{ include "smb-flexvol.labels" . | indent 4 }}
spec:
  capacity:
    storage: {{ .Values.smbVolume.capacity }}
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  flexVolume:
    driver: "microsoft.com/smb"
    secretRef:
      name: {{ .Values.smbVolume.credsSecretName }}
    options:
      source: //{{ .Values.smbVolume.server }}/{{ .Values.smbVolume.share }}
      mountoptions: {{ .Values.smbVolume.mountOptions }}
      
{{ end }}