pirmaryinfo fup

This commit is contained in:
2025-07-22 13:36:12 +02:00
parent 867fd7cb1d
commit a428e0d12f
2 changed files with 11 additions and 1 deletions

View File

@ -16,11 +16,14 @@ pingSentinel() {
getPrimaryInfo() {
masterName=${VALKEY_MASTER_NAME:-"mymaster"}
info=$(valkey-cli --csv -h ${VALKEY_HEADLESS_SERVICE} -p ${VALKEY_SENTINEL_PORT} sentinel get-primary-addr-by-name "${masterName}"| \
awk -F ',' '{ gsub(/"/,"",$0); print $1 " " $2 }')
if [ -z "${info}" ]; then
echo "Failed to get primary info for master '${masterName}'"
return 1
getPrimaryInfo
#return 1
fi
if [[ "${info}" =~ /^NULL/ ]]; then
getPrimaryInfo