Skip to content

Commit

Permalink
redis-ha: fix busybox-ash-ism in redis_liveness.sh (#294)
Browse files Browse the repository at this point in the history
* redis-ha: fix busybox-ash-ism in redis_liveness.sh

The ${response:0:7} syntax is non-POSIX and not understood by Debian's
dash shell, so if a Debian-based Redis image is used the liveness check
breaks on slaves. A case statement makes this check more legible anyway,
in my opinion, and works in all the POSIX-compatible shells (busybox
ash, dash, and bash).

Signed-off-by: Chris Boot <[email protected]>

* Update Chart.yaml

---------

Signed-off-by: Chris Boot <[email protected]>
Co-authored-by: Aaron Layfield <[email protected]>
  • Loading branch information
bootc and DandyDeveloper committed Aug 26, 2024
1 parent f5969c8 commit 56940ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- redis
- keyvalue
- database
version: 4.27.3
version: 4.27.4
appVersion: 7.2.4
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
Expand Down
9 changes: 5 additions & 4 deletions charts/redis-ha/templates/_configs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,12 @@
{{- end}}
ping
)
if [ "$response" != "PONG" ] && [ "${response:0:7}" != "LOADING" ] ; then
echo "$response"
exit 1
fi
echo "response=$response"
case $response in
PONG|LOADING*) ;;
*) exit 1 ;;
esac
exit 0
{{- end }}

{{- define "redis_readiness.sh" }}
Expand Down

0 comments on commit 56940ae

Please sign in to comment.