[bitnami/redis] prevents incorrect master host to be written to sentinel.conf (#12150)

* fix: prevents incorrect master host to be written to sentinel.conf

Signed-off-by: Florian Bachmann <florian.bachmann@web-computing.de>

* chore: bumps redis chart patch version

Signed-off-by: Florian Bachmann <florian.bachmann@web-computing.de>

Signed-off-by: Florian Bachmann <florian.bachmann@web-computing.de>
This commit is contained in:
Florian Bachmann
2022-08-26 19:45:06 +02:00
committed by GitHub
parent 39df1e709f
commit c6aa735f9d

View File

@@ -348,6 +348,13 @@ data:
{{- end }}
printf "\nsentinel myid %s" "$(host_id "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/sentinel.conf
if [[ -z "$REDIS_MASTER_HOST" ]] || [[ -z "$REDIS_MASTER_PORT_NUMBER" ]]
then
# Prevent incorrect configuration to be written to sentinel.conf
error "Redis master host is configured incorrectly (host: $REDIS_MASTER_HOST, port: $REDIS_MASTER_PORT_NUMBER)"
exit 1
fi
sentinel_conf_set "sentinel monitor" "{{ .Values.sentinel.masterSet }} "$REDIS_MASTER_HOST" "$REDIS_MASTER_PORT_NUMBER" {{ .Values.sentinel.quorum }}"
add_known_sentinel() {