fix(helm): Correctly set auth host

This commit is contained in:
Vegard Hagen
2023-04-10 21:40:14 +02:00
parent 01625b39d5
commit 44456d4465
3 changed files with 10 additions and 3 deletions
@@ -51,4 +51,11 @@ Returns string "true" or empty which will be evaluated to boolean false
{{- if or .Values.authOnly (and .Values.auth.enabled .Values.auth.create (include "ingressRoute.create" .)) }}
{{- true }}
{{- end }}
{{- end }}
{{/*
Return default auth host or custom value if set
*/}}
{{- define "auth.host" -}}
{{ .Values.auth.host | default (print "auth-" .Values.namespace "." .Values.auth.cookieDomain ) }}
{{- end }}
@@ -24,7 +24,7 @@ spec:
{{- end }}
{{- end }}
{{- if include "auth.create" . }}
- match: Host(`{{ .Values.auth.host }}.stonegarden.dev`)
- match: Host(`{{ include "auth.host" . }}`)
kind: Rule
services:
- name: traefik-forward-auth
@@ -13,8 +13,8 @@ data:
traefik-forward-auth.ini: |-
cookie-name = {{ .Values.auth.cookieName | default (print "_" .Values.namespace "_auth") | quote }}
cookie-domain = {{ .Values.auth.cookieDomain | quote }}
auth-host = {{ .Values.auth.host | default (print "auth-" .Values.namespace "." .Values.auth.cookieDomain ) | quote}}
log-level = {{ .Values.auth.logLevel | quote}}
auth-host = {{ include "auth.host" . | quote }}
log-level = {{ .Values.auth.logLevel | quote }}
{{- range .Values.auth.domains }}
domain = {{ . | quote }}
{{- end }}