From d87d2d6d640b6158fb8f16e136761e619d9fb51b Mon Sep 17 00:00:00 2001 From: Y-Rookie Date: Tue, 16 Jul 2024 20:56:11 +0800 Subject: [PATCH] release 0.9 supports disable display redis password in scripts --- addons/redis/scripts/redis-sentinel-setup.sh | 2 +- addons/redis/scripts/redis-sentinel-start.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/redis/scripts/redis-sentinel-setup.sh b/addons/redis/scripts/redis-sentinel-setup.sh index 42073a2cd..1f4d66b69 100755 --- a/addons/redis/scripts/redis-sentinel-setup.sh +++ b/addons/redis/scripts/redis-sentinel-setup.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -ex +set -e # Based on the ClusterDefinition API, redis sentinel deployed with redis together, it will be deprecated in the future. diff --git a/addons/redis/scripts/redis-sentinel-start.sh b/addons/redis/scripts/redis-sentinel-start.sh index e42c088d7..8d069d4a2 100755 --- a/addons/redis/scripts/redis-sentinel-start.sh +++ b/addons/redis/scripts/redis-sentinel-start.sh @@ -26,6 +26,7 @@ set -ex {{- /* build redis engine service */}} {{- $primary_svc := printf "%s-%s.%s.svc" $clusterName $redis_component.name $namespace }} echo "Waiting for redis service {{ $primary_svc }} to be ready..." +set +x if [ ! -z "$REDIS_DEFAULT_PASSWORD" ]; then timeout 300 sh -c 'until redis-cli -h {{ $primary_svc }} -p 6379 -a $REDIS_DEFAULT_PASSWORD ping; do sleep 2; done' else @@ -35,6 +36,7 @@ if [ $? -ne 0 ]; then echo "Redis service is not ready, exiting..." exit 1 fi +set -x echo "Redis service ready, Starting sentinel..." kb_pod_fqdn="$KB_POD_NAME.$KB_CLUSTER_COMP_NAME-headless.$KB_NAMESPACE.svc" echo "sentinel announce-ip $kb_pod_fqdn" >> /etc/sentinel/redis-sentinel.conf