Skip to content

Commit

Permalink
release 0.9 supports disable display redis password in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Rookie committed Jul 16, 2024
1 parent d2860cd commit d87d2d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/redis/scripts/redis-sentinel-setup.sh
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 2 additions & 0 deletions addons/redis/scripts/redis-sentinel-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d87d2d6

Please sign in to comment.