{{- if .Values.localvolumeset.enabled }}
apiVersion: local.storage.openshift.io/v1alpha1
kind: LocalVolumeSet
metadata:
  name: auto-detect-volumes
  namespace: openshift-local-storage
  annotations:
    argocd.argoproj.io/sync-wave: "4"
spec:
  nodeSelector:
    nodeSelectorTerms:
      - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
              {{- range .Values.localvolumeset.nodeSelector }}
              - {{ . }}
              {{- end }}
  storageClassName: {{ .Values.localvolumeset.storageClassName | default "local-sc" }}
  volumeMode: Filesystem
  fsType: ext4
  maxDeviceCount: {{ .Values.localvolumeset.maxDeviceCount | default 10 }}
  deviceInclusionSpec:
    deviceTypes:
      {{- range .Values.localvolumeset.deviceInclusionSpec.deviceTypes }}
      - {{ . }}
      {{- end }}
    deviceMechanicalProperties:
      {{- if .Values.localvolumeset.deviceInclusionSpec.deviceMechanicalProperties }}
      {{- range .Values.localvolumeset.deviceInclusionSpec.deviceMechanicalProperties }}
      - {{ . }}
      {{- end }}
      {{- end }}
    minSize: {{ .Values.localvolumeset.deviceInclusionSpec.minSize | default "10G" }}
    maxSize: {{ .Values.localvolumeset.deviceInclusionSpec.maxSize | default "100G" }}
{{- end }}
