{{- if .Values.localStorage.enabled }}
{{- range .Values.localStorage.localvolumes }}
apiVersion: "local.storage.openshift.io/v1"
kind: "LocalVolume"
metadata:
  name: "local-disks-{{ .volumeMode | lower }}"
  namespace: "openshift-local-storage" 
  annotations:
    argocd.argoproj.io/sync-wave: "4"
spec:
  nodeSelector: 
    nodeSelectorTerms:
      - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            {{- range .nodeSelector }}
            - {{ . }}
            {{- end }}
  storageClassDevices:
    - storageClassName: "local{{ .volumeMode | lower }}-sc" 
      volumeMode: {{ .volumeMode }}
      {{- if .fsType }}
      fsType: {{ .fsType }}
      {{- end }}
      devicePaths: 
        {{- range .devicePaths }}
        - {{ . }}
        {{- end }}
{{- end }}
{{- end }}
