Skip to content

Commit

Permalink
update[storage-charts-repackage]: add storage-charts-repackage storag…
Browse files Browse the repository at this point in the history
…eclass.yaml array type update

Signed-off-by: jie.li <jie.li@daocloud.io>
  • Loading branch information
angel0507 committed Jan 9, 2023
1 parent fd7f183 commit 0b28878
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions charts/hwameistor/hwameistor/templates/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
{{- range $storageclass := .Values.storageClass -}}
---
{{- define "replicaNumber" -}}
{{- if .Values.storageClass.enableHA -}}
{{- if $storageclass.enableHA -}}
{{- print 2 -}}
{{- else -}}
{{- print 1 -}}
{{- end -}}
{{- end -}}

{{- if .Values.storageClass.enabled -}}
{{- if $storageclass.enabled -}}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.kubernetes.io/is-default-class: {{ .Values.storageClass.default | quote }}
name: hwameistor-storage-lvm-{{ .Values.storageClass.diskType | lower}}
storageclass.kubernetes.io/is-default-class: {{ $storageclass.default | quote }}
name: hwameistor-storage-lvm-{{ $storageclass.diskType | lower}}
provisioner: lvm.hwameistor.io
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
allowVolumeExpansion: {{ $storageclass.allowVolumeExpansion }}
reclaimPolicy: {{ $storageclass.reclaimPolicy }}
parameters:
replicaNumber: {{ include "replicaNumber" . | quote}}
poolClass: {{ .Values.storageClass.diskType | quote}}
poolClass: {{ $storageclass.diskType | quote}}
poolType: "REGULAR"
volumeKind: "LVM"
striped: "true"
convertible: {{ .Values.storageClass.convertible | quote}}
csi.storage.k8s.io/fstype: {{ .Values.storageClass.fsType | quote}}
convertible: {{ $storageclass.convertible | quote}}
csi.storage.k8s.io/fstype: {{ $storageclass.fsType | quote}}
{{- end }}
{{ end }}

0 comments on commit 0b28878

Please sign in to comment.