Skip to content

Commit

Permalink
Fixed connection problems with cluster nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
ligreman committed Feb 12, 2022
1 parent d719975 commit b2c05bc
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "kong-proxy-cache-redis-cluster-plugin"
version = "1.0.0-0"
version = "1.0.0-1"

source = {
url = "git://github.com/ligreman/kong-proxy-cache-redis-cluster-plugin"
Expand Down
2 changes: 1 addition & 1 deletion kong/plugins/proxy-cache-redis-cluster/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ local function store_cache_value(premature, conf, req_body, status, proxy_cache)
end

local ProxyCacheHandler = {
VERSION = "1.0.0-0",
VERSION = "1.0.0-1",
PRIORITY = 902,
}

Expand Down
5 changes: 3 additions & 2 deletions kong/plugins/proxy-cache-redis-cluster/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ local function red_connect(opts)
max_redirection = (opts.cluster_max_redirection or 16),
max_connection_attempts = (opts.cluster_max_connection_attempts or 3),
auth = (opts.cluster_password or nil),
auth_user = (opts.cluster_user or nil),
connect_opts = {
ssl = (opts.cluster_use_ssl_connection or false),
pool = "redis-cluster-connection-pool",
Expand All @@ -61,8 +62,8 @@ local function red_connect(opts)
end

-- Support for ACL (we send AUTH username password)
if is_present(opts.cluster_user) and is_present(opts.cluster_password) then
config.auth = opts.cluster_user .. " " .. opts.cluster_password
if is_present(opts.cluster_user) then
config.auth_user = opts.cluster_user
end

local red, err_redis = redis_cluster:new(config)
Expand Down
Loading

0 comments on commit b2c05bc

Please sign in to comment.