Skip to content

Commit

Permalink
fix redis readiness to handle for no password
Browse files Browse the repository at this point in the history
  • Loading branch information
DaedalusG committed May 27, 2024
1 parent 97f205f commit f28e816
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions base/redis/redis-cache.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ spec:
- containerPort: 6379
name: redis
readinessProbe:
initialDelaySeconds: 5
initialDelaySeconds: 10
timeoutSeconds: 5
exec:
command:
- /bin/sh
- -c
- |
#!/bin/bash
if [ -f /etc/redis/redis.conf ]; then
export REDISCLI_AUTH=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
PASS_CHECK=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
if [ ! -z "$PASS_CHECK" ]; then
export REDISCLI_AUTH="$PASS_CHECK"
fi
response=$(
redis-cli ping
Expand Down
8 changes: 5 additions & 3 deletions base/redis/redis-store.Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ spec:
- containerPort: 6379
name: redis
readinessProbe:
initialDelaySeconds: 5
initialDelaySeconds: 10
timeoutSeconds: 5
exec:
command:
- /bin/sh
- -c
- |
#!/bin/bash
if [ -f /etc/redis/redis.conf ]; then
export REDISCLI_AUTH=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
PASS_CHECK=$(grep -h "requirepass" /etc/redis/redis.conf | cut -d ' ' -f 2)
if [ ! -z "$PASS_CHECK" ]; then
export REDISCLI_AUTH="$PASS_CHECK"
fi
response=$(
redis-cli ping
Expand Down

0 comments on commit f28e816

Please sign in to comment.