Skip to content

Commit

Permalink
test validate values
Browse files Browse the repository at this point in the history
  • Loading branch information
micheelengronne committed Feb 6, 2025
1 parent 7b8b6b6 commit 2938137
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions charts/trino/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ Get the application URL by running these commands:
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:8080
{{- end }}

{{- include "trino.validateValues" . }}
20 changes: 20 additions & 0 deletions charts/trino/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,23 @@ Create the secret name for the group-provider file
{{- end }}
{{- end }}
{{- end }}
{{/* Compile all validation warnings into a single message and call fail. */}}
{{- define "trino.validateValues" -}}
{{- $messages := list -}}
{{- $messages = append $messages (include "mychart.validateValues.httpsonly.enabled" .) -}}
{{- $messages = without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
{{- end -}}
{{- end -}}
{{/* Validate value of https.only */}}
{{- define "mychart.validateValues.httpsonly" -}}
{{- if and .Values.server.config.https.only (not .Values.server.config.https.enabled) -}}
trino: .Values.server.config.https.only
`.Values.server.config.https.only` requires .Values.server.config.https.enabled
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/trino/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
service:
name: {{ include "trino.fullname" $ }}
port:
{{- if $.Values.ingress.tlsService }}
{{- if and $.Values.server.config.https.enabled $.Values.ingress.tlsService }}
number: {{ $.Values.service.tlsPort }}
{{- else }}
number: {{ $.Values.service.port }}
Expand Down
2 changes: 2 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ server:
enabled: false
# -- Enable communications between coordinator and workers through https. It depends on https being enabled
internal: false
# -- Disable http server completely. It requires https.internal and ingress.tlsService (if Ingress is configured)
only: false
keystore:
path: ""
key: ""
Expand Down

0 comments on commit 2938137

Please sign in to comment.