Skip to content

Commit

Permalink
chore(clustering): cleanup redundant checkers
Browse files Browse the repository at this point in the history
some logic in checkers is made redundant by the fact the same fields
exist in removed_fields, so it would never be reached.

This commit removes the redundant logic
  • Loading branch information
samugi committed May 10, 2024
1 parent d112f3c commit 475ecfe
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions kong/clustering/compat/checkers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,6 @@ local compatible_checkers = {
for _, plugin in ipairs(config_table.plugins or {}) do
if plugin.name == 'ai-proxy' then
local config = plugin.config
if config.model and config.model.options then
if config.response_streaming then
config.response_streaming = nil
log_warn_message('configures ' .. plugin.name .. ' plugin with' ..
' response_streaming == nil, because it is not supported' ..
' in this release',
dp_version, log_suffix)
has_update = true
end

if config.model.options.upstream_path then
config.model.options.upstream_path = nil
log_warn_message('configures ' .. plugin.name .. ' plugin with' ..
' upstream_path == nil, because it is not supported' ..
' in this release',
dp_version, log_suffix)
has_update = true
end
end

if config.route_type == "preserve" then
config.route_type = "llm/v1/chat"
log_warn_message('configures ' .. plugin.name .. ' plugin with' ..
Expand All @@ -59,20 +39,6 @@ local compatible_checkers = {
has_update = true
end
end

if plugin.name == 'ai-request-transformer' or plugin.name == 'ai-response-transformer' then
local config = plugin.config
if config.llm.model
and config.llm.model.options
and config.llm.model.options.upstream_path then
config.llm.model.options.upstream_path = nil
log_warn_message('configures ' .. plugin.name .. ' plugin with' ..
' upstream_path == nil, because it is not supported' ..
' in this release',
dp_version, log_suffix)
has_update = true
end
end
end

return has_update
Expand Down

0 comments on commit 475ecfe

Please sign in to comment.