mirror of https://git.rancher.io/charts
(dev-v2.6-archive) Add validation on trying to deploy Grafana PVC
(partially cherry picked from commit 75a96a7e94
)
pull/1680/head
parent
b78b04ad05
commit
470ce9ee46
|
@ -0,0 +1,18 @@
|
|||
--- charts-original/templates/pvc.yaml
|
||||
+++ charts/templates/pvc.yaml
|
||||
@@ -16,12 +16,14 @@
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
+{{- $_ := required "Must provide at least one access mode for persistent volumes used by Grafana" .Values.persistence.accessModes }}
|
||||
+{{- $_ := required "Must provide at least one access mode for persistent volumes used by Grafana" (first .Values.persistence.accessModes) }}
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
- storage: {{ .Values.persistence.size | quote }}
|
||||
+ storage: {{ required "Must provide size for persistent volumes used by Grafana" .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClassName }}
|
||||
storageClassName: {{ .Values.persistence.storageClassName }}
|
||||
{{- end -}}
|
|
@ -0,0 +1,17 @@
|
|||
--- charts-original/templates/statefulset.yaml
|
||||
+++ charts/templates/statefulset.yaml
|
||||
@@ -39,11 +39,13 @@
|
||||
- metadata:
|
||||
name: storage
|
||||
spec:
|
||||
+{{- $_ := required "Must provide at least one access mode for persistent volumes used by Grafana" .Values.persistence.accessModes }}
|
||||
+{{- $_ := required "Must provide at least one access mode for persistent volumes used by Grafana" (first .Values.persistence.accessModes) }}
|
||||
accessModes: {{ .Values.persistence.accessModes }}
|
||||
storageClassName: {{ .Values.persistence.storageClassName }}
|
||||
resources:
|
||||
requests:
|
||||
- storage: {{ .Values.persistence.size }}
|
||||
+ storage: {{ required "Must provide size for persistent volumes used by Grafana" .Values.persistence.size }}
|
||||
{{- with .Values.persistence.selectorLabels }}
|
||||
selector:
|
||||
matchLabels:
|
Loading…
Reference in New Issue