mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/nats] Use a validate helper to detect invalid configurations (#13745)
* [stable/nats] Use a validate helper to detect invalid configurations Signed-off-by: juan131 <juan@bitnami.com> * Remove extra line Signed-off-by: juan131 <juan@bitnami.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
205380762b
commit
b4c658c966
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: nats
|
||||
version: 2.5.0
|
||||
version: 2.5.1
|
||||
appVersion: 1.4.1
|
||||
description: An open-source, cloud-native messaging system
|
||||
keywords:
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
{{- if and (not (eq .Values.resourceType "statefulset")) (not (eq .Values.resourceType "deployment")) }}
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
"resourceType" currently only "statefulset", "deployment" are allowed
|
||||
the type specified in values.yaml >> {{ .Values.resourceType }} << is not defined in white list
|
||||
but it will still continuing deploy with default resource type "statefulset"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
|
||||
{{- if or (contains .Values.client.service.type "LoadBalancer") (contains .Values.client.service.type "nodePort") }}
|
||||
{{- if not .Values.auth.enabled }}
|
||||
{{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }}
|
||||
@@ -97,4 +85,7 @@ To access the Monitoring svc from outside the cluster, follow the steps below:
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} {{ template "nats.fullname" . }}-0 {{ .Values.metrics.port }}:{{ .Values.metrics.port }}
|
||||
|
||||
4. Access NATS Prometheus metrics by opening the URL obtained in a browser.
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- include "nats.validateValues" . -}}
|
||||
|
||||
@@ -119,3 +119,26 @@ imagePullSecrets:
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
{{- define "nats.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := append $messages (include "nats.validateValues.resourceType" .) -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of NATS - must provide a valid resourceType ("deployment" or "statefulset") */}}
|
||||
{{- define "nats.validateValues.resourceType" -}}
|
||||
{{- if and (ne .Values.resourceType "deployment") (ne .Values.resourceType "statefulset") -}}
|
||||
nats: resourceType
|
||||
Invalid resourceType selected. Valid values are "deployment" and
|
||||
"statefulset". Please set a valid mode (--set resourceType="xxxx")
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user