mirror of
https://github.com/bitnami/charts.git
synced 2026-03-16 06:47:30 +08:00
docs and validation
This commit is contained in:
@@ -17,3 +17,5 @@ To access the Memcached Prometheus metrics from outside the cluster execute the
|
||||
curl http://127.0.0.1:{{ .Values.metrics.service.port }}/metrics
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- include "memcached.validateValues" . }}
|
||||
|
||||
@@ -165,6 +165,42 @@ but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
{{- define "memcached.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := append $messages (include "memcached.validateValues.architecture" .) -}}
|
||||
{{- $messages := append $messages (include "memcached.validateValues.replicaCount" .) -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Memcached - must provide a valid architecture */}}
|
||||
{{- define "memcached.validateValues.architecture" -}}
|
||||
{{- if and (ne .Values.architecture "standalone") (ne .Values.architecture "high-availability") -}}
|
||||
memcached: architecture
|
||||
Invalid architecture selected. Valid values are "standalone" and
|
||||
"high-availability". Please set a valid architecture (--set architecture="xxxx")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of InfluxDB - number of replicas */}}
|
||||
{{- define "memcached.validateValues.replicaCount" -}}
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- if and (eq .Values.architecture "standalone") (gt $replicaCount 1) -}}
|
||||
memcached: replicaCount
|
||||
The standalone architecture doesn't allow to run more than 1 replica.
|
||||
Please set a valid number of replicas (--set memcached.replicaCount=1) or
|
||||
use the "high-availability" architecture (--set architecture="high-availability")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
|
||||
Reference in New Issue
Block a user