[bitnami/redis-cluster] fix nodes.conf not found (#28670)

When the container is stopped after the entrypoint scripts are completed and
before the redis server starts, nodes.sh is created but nodes.conf is missing.
This prevents the entrypoint to successfully complete on next restart.
This change fixes this behavior by checking the existence of nodes.conf
in the entrypoint scripts.

Signed-off-by: Hisanobu Tomari <posco.grubb@gmail.com>
This commit is contained in:
Hisanobu Tomari 2023-03-31 15:49:34 +09:00 committed by GitHub
parent 3844561860
commit 20c6ccdc63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ redis_cluster_update_ips() {
read -ra nodes <<< "$(tr ',;' ' ' <<< "${REDIS_NODES}")"
declare -A host_2_ip_array # Array to map hosts and IPs
# Update the IPs when a number of nodes > quorum change their IPs
if [[ ! -f "${REDIS_DATA_DIR}/nodes.sh" ]]; then
if [[ ! -f "${REDIS_DATA_DIR}/nodes.sh" || ! -f "${REDIS_DATA_DIR}/nodes.conf" ]]; then
# It is the first initialization so store the nodes
for node in "${nodes[@]}"; do
read -r -a host_and_port <<< "$(to_host_and_port "$node")"

View File

@ -204,7 +204,7 @@ redis_cluster_update_ips() {
read -ra nodes <<< "$(tr ',;' ' ' <<< "${REDIS_NODES}")"
declare -A host_2_ip_array # Array to map hosts and IPs
# Update the IPs when a number of nodes > quorum change their IPs
if [[ ! -f "${REDIS_DATA_DIR}/nodes.sh" ]]; then
if [[ ! -f "${REDIS_DATA_DIR}/nodes.sh" || ! -f "${REDIS_DATA_DIR}/nodes.conf" ]]; then
# It is the first initialization so store the nodes
for node in "${nodes[@]}"; do
read -r -a host_and_port <<< "$(to_host_and_port "$node")"