Skip to content

Commit 3ae8eeb

Browse files
authored
Reintroduce auth env vars used by valkey-cli (#12)
Connected to RUNT-11
1 parent afc9ca2 commit 3ae8eeb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docker-images/valkey/valkey-entrypoint/entrypoint

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ echo "Starting Valkey server in ${VALKEY_NODE_TYPE:-valkey} mode"
1717

1818
args=()
1919
if [[ ${VALKEY_NODE_TYPE:-} != "sentinel" ]]; then
20-
args=( "${args[@]}" --user valkey )
20+
args=("${args[@]}" --user valkey)
2121
fi
2222

2323
exec /usr/local/bin/docker-entrypoint.sh "${args[@]}" "$@"

docker-images/valkey/valkey-entrypoint/functions

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ run_sentinel_cmd() {
1717
shift
1818
local cmd_output
1919

20+
export VALKEY_PASSWORD="${VALKEY_SENTINEL_PASSWORD:-}"
21+
export REDISCLI_AUTH="${VALKEY_SENTINEL_PASSWORD:-}"
22+
2023
# shellcheck disable=SC2086
2124
cmd_output=$(valkey-cli $common_args -h "$sentinel_host" -p 26379 sentinel "$@")
2225

@@ -48,6 +51,9 @@ get_master_addr_by_name() {
4851
local sentinel_host="$1"
4952
local valkey_name="$2"
5053

54+
export VALKEY_PASSWORD="${VALKEY_SENTINEL_PASSWORD:-}"
55+
export REDISCLI_AUTH="${VALKEY_SENTINEL_PASSWORD:-}"
56+
5157
# shellcheck disable=SC2086
5258
output=$(valkey-cli $common_args --json -h "$sentinel_host" -p 26379 sentinel get-master-addr-by-name "$valkey_name")
5359
echo "$output"
@@ -56,6 +62,9 @@ get_master_addr_by_name() {
5662
wait_for_sentinel() {
5763
local sentinel_host="$1"
5864

65+
export VALKEY_PASSWORD="${VALKEY_SENTINEL_PASSWORD:-}"
66+
export REDISCLI_AUTH="${VALKEY_SENTINEL_PASSWORD:-}"
67+
5968
echo "Waiting for Valkey Sentinel to be ready"
6069
local timeout=$((SECONDS + STARTUP_TIMEOUT))
6170

0 commit comments

Comments
 (0)