Skip to content

Commit

Permalink
3.8 CP config is not refused by 3.6.1 DP
Browse files Browse the repository at this point in the history
  • Loading branch information
gruceo committed Aug 16, 2024
1 parent d997971 commit 3ff5eb8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/clustering/compat/checkers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ local compatible_checkers = {
local config = plugin.config
if config.storage_config.redis.username ~= nil then
log_warn_message('configures ' .. plugin.name .. ' plugin with redis username',
'not work in this release.',
'not work in this release',
dp_version, log_suffix)
end

if config.storage_config.redis.password ~= nil then
log_warn_message('configures ' .. plugin.name .. ' plugin with redis password',
'not work in this release. Please use redis.auth config instead.',
'not work in this release. Please use redis.auth config instead',
dp_version, log_suffix)
end
end
Expand Down
56 changes: 56 additions & 0 deletions spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,62 @@ describe("CP/DP config compat transformations #" .. strategy, function()

describe("compatibility tests for redis standarization", function()
describe("acme plugin", function()
it("translates standardized redis config to older acme structure", function()
-- [[ 3.8.x ]] --
local acme = admin.plugins:insert {
name = "acme",
enabled = true,
config = {
account_email = "test@example.com",
storage = "redis",
storage_config = {
-- [[ new structure redis
redis = {
host = "localhost",
port = 57198,
username = "test",
password = "secret",
database = 2,
timeout = 1100,
ssl = true,
ssl_verify = true,
server_name = "example.test",
extra_options = {
namespace = "test_namespace",
scan_count = 13
}
}
-- ]]
}
}
}

local expected_acme_prior_38 = cycle_aware_deep_copy(acme)
expected_acme_prior_38.config.storage_config.redis = {
host = "localhost",
port = 57198,
username = "test",
auth = "secret",
password = "secret",
database = 2,
ssl = true,
ssl_verify = true,
ssl_server_name = "example.test",
namespace = "test_namespace",
scan_count = 13,
timeout = 1100,
server_name = "example.test",
extra_options = {
namespace = "test_namespace",
scan_count = 13
}
}
do_assert(uuid(), "3.6.1", expected_acme_prior_38)

-- cleanup
admin.plugins:remove({ id = acme.id })
end)

it("translates standardized redis config to older acme structure", function()
-- [[ 3.6.x ]] --
local acme = admin.plugins:insert {
Expand Down

0 comments on commit 3ff5eb8

Please sign in to comment.