-
Notifications
You must be signed in to change notification settings - Fork 112
/
00-validation-checks.yml
23 lines (19 loc) · 1.8 KB
/
00-validation-checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{- $database_type := .Values.readyset.common.config.database_type -}}
{{- $skipChecks := .Values.global.debugModeEnabled -}}
{{- $skipChecksMsg := "\n\nSet global.debugModeEnabled to forcefully skip this error, although it's not generally advised unless you know what you're doing." -}}
{{/* Is the database database_type requested valid? */}}
{{- if and (ne .Values.readyset.common.config.database_type "mysql") (ne .Values.readyset.common.config.database_type "postgresql") (eq $skipChecks false) }}
{{ fail (printf "\n\nError In Values File Entry:\n\treadyset.common.config.database_type is invalid.\n\n Check values.yaml for available options. %s" $skipChecksMsg) }}
{{ end }}
{{/* Is the deployment name set? */}}
{{- if and (eq .Values.readyset.common.config.deploymentName "") (not $skipChecks) }}
{{ fail (printf "\n\nError In Values File Entry:\n\treadyset.common.config.deploymentName: must be set to a non-blank string value.\n\nPlease provide a value in the chart and try again. %s" $skipChecksMsg) }}
{{ end }}
{{/* Is the CloudWatch log group name set? */}}
{{- if and (eq .Values.readyset.common.config.cwLogGroupName "") (eq $skipChecks false) }}
{{ fail (printf "\n\nError In Values File Entry:\n\treadyset.common.config.cwLogGroupName: must be set to a non-blank string value\n\nPlease provide a value in the chart and try again. %s" $skipChecksMsg) }}
{{ end }}
{{/* Is quorum config equal to ReadySet server replicas in statefulset? */}}
{{- if and (ne .Values.readyset.common.config.quorum .Values.readyset.server.deploymentConfig.replicas) (eq $skipChecks false) }}
{{ fail (printf "\n\nError In Values File Entry:\n\treadyset.common.config.quorum: value != readyset.server.deploymentConfig.replicas. These two parameters should have the same value under normal conditions. %s" $skipChecksMsg) }}
{{ end }}