Skip to content

Commit

Permalink
Merge pull request #576 from mpihlak/fix-redis-liveness-probe
Browse files Browse the repository at this point in the history
Fix command line for Redis liveness probe
  • Loading branch information
ese authored Apr 21, 2023
2 parents f027bb9 + 8e94166 commit 33b2339
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/operator/custom-startup-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
data:
startup.sh: |
#!/bin/bash
redis-cli -h 127.0.0.1 -p ${REDIS_PORT} ping --user pinger --pass pingpass --no-auth-warning
redis-cli -h 127.0.0.1 -p ${REDIS_PORT} --user pinger --pass pingpass --no-auth-warning ping | grep PONG
---
apiVersion: databases.spotahome.com/v1
kind: RedisFailover
Expand Down
2 changes: 1 addition & 1 deletion operator/redisfailover/service/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func generateRedisStatefulSet(rf *redisfailoverv1.RedisFailover, labels map[stri
Command: []string{
"sh",
"-c",
fmt.Sprintf("redis-cli -h $(hostname) -p %[1]v ping --user pinger --pass pingpass --no-auth-warning", rf.Spec.Redis.Port),
fmt.Sprintf("redis-cli -h $(hostname) -p %[1]v --user pinger --pass pingpass --no-auth-warning ping | grep PONG", rf.Spec.Redis.Port),
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions operator/redisfailover/service/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ func TestRedisCustomLivenessProbe(t *testing.T) {
Command: []string{
"sh",
"-c",
"redis-cli -h 127.0.0.1 -p ${REDIS_PORT} ping --user pinger --pass pingpass --no-auth-warning",
"redis-cli -h 127.0.0.1 -p ${REDIS_PORT} --user pinger --pass pingpass --no-auth-warning ping | grep PONG",
},
},
},
Expand All @@ -1913,7 +1913,7 @@ func TestRedisCustomLivenessProbe(t *testing.T) {
Command: []string{
"sh",
"-c",
"redis-cli -h 127.0.0.1 -p ${REDIS_PORT} ping --user pinger --pass pingpass --no-auth-warning",
"redis-cli -h 127.0.0.1 -p ${REDIS_PORT} --user pinger --pass pingpass --no-auth-warning ping | grep PONG",
},
},
},
Expand All @@ -1932,7 +1932,7 @@ func TestRedisCustomLivenessProbe(t *testing.T) {
Command: []string{
"sh",
"-c",
"redis-cli -h $(hostname) -p 6379 ping --user pinger --pass pingpass --no-auth-warning",
"redis-cli -h $(hostname) -p 6379 --user pinger --pass pingpass --no-auth-warning ping | grep PONG",
},
},
},
Expand Down

0 comments on commit 33b2339

Please sign in to comment.