Fix disabling internal redis installation and validate state of redis.enabled and redis.host
This commit is contained in:
parent
7d86a26e14
commit
8406f013d9
2 changed files with 14 additions and 6 deletions
|
@ -7,11 +7,7 @@ Expand the name of the chart.
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "funkwhale.dbUrl" -}}
|
{{- define "funkwhale.dbUrl" -}}
|
||||||
postgres://{{ .Values.database.user}}:{{ .Values.database.password }}@{{ .Values.database.host }}:{{ .Values.database.port }}/{{ .Values.database.database }}
|
postgres://{{ .Values.database.user }}:{{ .Values.database.password }}@{{ .Values.database.host }}:{{ .Values.database.port }}/{{ .Values.database.database }}
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "funkwhale.redisUrl" -}}
|
|
||||||
redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:{{ .Values.redis.redisPort }}/0
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
|
@ -45,3 +41,15 @@ Create the correct image tag name
|
||||||
{{- define "funkwhale.imageTag" -}}
|
{{- define "funkwhale.imageTag" -}}
|
||||||
{{- .Values.image.tag | default .Chart.AppVersion -}}
|
{{- .Values.image.tag | default .Chart.AppVersion -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "funkwhale.redisUrl" -}}
|
||||||
|
{{- if and .Values.redis.enabled .Values.redis.host -}}
|
||||||
|
{{ fail "Setting both redis.enabled and redis.host will deploy an internal Redis service and attempt to use an external one - please set only one of the two!" }}
|
||||||
|
{{- else if .Values.redis.enabled -}}
|
||||||
|
redis://:{{ .Values.redis.password }}@{{ template "funkwhale.fullname" . }}:{{ .Values.redis.redisPort }}/0
|
||||||
|
{{- else if .Values.redis.host -}}
|
||||||
|
redis://:{{ .Values.redis.password }}@{{ .Values.redis.host }}:{{ .Values.redis.redisPort }}/0
|
||||||
|
{{- else -}}
|
||||||
|
{{ fail "Either redis.enabled or redis.host are required!" }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
@ -51,7 +51,7 @@ redis:
|
||||||
# this to false and adjust the host to use your existing service.
|
# this to false and adjust the host to use your existing service.
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
host: {{ template "funkwhale.fullname" . }}-redis-master
|
host: ''
|
||||||
redisPort: 6379
|
redisPort: 6379
|
||||||
password: funkwhale
|
password: funkwhale
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue