From d525d676d003fc656d5cfc95257551a29e9d753b Mon Sep 17 00:00:00 2001 From: Shubham Gupta <69793468+shubham-cmyk@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:44:22 +0530 Subject: [PATCH] [Fix] : Add Cluster Announce IP and HostName (#54) * remove v7 check Signed-off-by: Shubham Gupta * fix v7 Signed-off-by: Shubham Gupta * fix location Signed-off-by: Shubham Gupta --------- Signed-off-by: Shubham Gupta --- entrypoint.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4c99442..60d11b6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -111,10 +111,19 @@ start_redis() { else CLUSTER_ANNOUNCE_IP="${POD_IP}" fi + + if [[ "${REDIS_MAJOR_VERSION}" != "v7" ]]; then + redis-server /etc/redis/redis.conf \ + --cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" \ + --cluster-announce-hostname "${POD_HOSTNAME}" + else + { + echo cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" + echo cluster-announce-hostname "${POD_HOSTNAME}" + } >> /etc/redis/redis.conf - redis-server /etc/redis/redis.conf \ - --cluster-announce-ip "${CLUSTER_ANNOUNCE_IP}" \ - --cluster-announce-hostname "${POD_HOSTNAME}" + redis-server /etc/redis/redis.conf + fi else echo "Starting redis service in standalone mode....."