# Source: gitea/charts/redis-cluster/templates/scripts-configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: gitea-redis-cluster-scripts namespace: "vynil-ci" labels: app.kubernetes.io/instance: gitea app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: redis-cluster helm.sh/chart: redis-cluster-9.0.12 data: ping_readiness_local.sh: |- #!/bin/sh set -e REDIS_STATUS_FILE=/tmp/.redis_cluster_check if [ ! -z "$REDIS_PASSWORD" ]; then export REDISCLI_AUTH=$REDIS_PASSWORD; fi; response=$( timeout -s 15 $1 \ redis-cli \ -h localhost \ -p $REDIS_PORT_NUMBER \ ping ) if [ "$?" -eq "124" ]; then echo "Timed out" exit 1 fi if [ "$response" != "PONG" ]; then echo "$response" exit 1 fi if [ ! -f "$REDIS_STATUS_FILE" ]; then response=$( timeout -s 15 $1 \ redis-cli \ -h localhost \ -p $REDIS_PORT_NUMBER \ CLUSTER INFO | grep cluster_state | tr -d '[:space:]' ) if [ "$?" -eq "124" ]; then echo "Timed out" exit 1 fi if [ "$response" != "cluster_state:ok" ]; then echo "$response" exit 1 else touch "$REDIS_STATUS_FILE" fi fi ping_liveness_local.sh: |- #!/bin/sh set -e if [ ! -z "$REDIS_PASSWORD" ]; then export REDISCLI_AUTH=$REDIS_PASSWORD; fi; response=$( timeout -s 15 $1 \ redis-cli \ -h localhost \ -p $REDIS_PORT_NUMBER \ ping ) if [ "$?" -eq "124" ]; then echo "Timed out" exit 1 fi responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}') if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then echo "$response" exit 1 fi