mirror of
https://github.com/bitnami/charts.git
synced 2026-02-20 20:17:21 +08:00
[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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user