From 20c6ccdc63841242bd75ffccf2d2123150fb8a9e Mon Sep 17 00:00:00 2001 From: Hisanobu Tomari Date: Fri, 31 Mar 2023 15:49:34 +0900 Subject: [PATCH] [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 --- .../6.2/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh | 2 +- .../7.0/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitnami/redis-cluster/6.2/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh b/bitnami/redis-cluster/6.2/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh index 17f4a9b69d3d..066bc04249b3 100644 --- a/bitnami/redis-cluster/6.2/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh +++ b/bitnami/redis-cluster/6.2/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh @@ -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")" diff --git a/bitnami/redis-cluster/7.0/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh b/bitnami/redis-cluster/7.0/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh index 17f4a9b69d3d..066bc04249b3 100644 --- a/bitnami/redis-cluster/7.0/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh +++ b/bitnami/redis-cluster/7.0/debian-11/rootfs/opt/bitnami/scripts/librediscluster.sh @@ -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")"