Skip to content

Commit

Permalink
fix(pluginserver): ensure a change to plugin config takes effect (#12718
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 97c2651)
  • Loading branch information
gszr authored and AndyZhang0707 committed Mar 19, 2024
1 parent f6868a8 commit b829184
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/kong/fix-external-plugin-instance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
message: |
Fix an issue where an external plugin (Go, Javascript, or Python) would fail to
apply a change to the plugin config via the Admin API.
type: bugfix
scope: Configuration
3 changes: 3 additions & 0 deletions kong/runloop/plugin_servers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ function get_instance_id(plugin_name, conf)

if instance_info
and instance_info.id
and instance_info.seq == conf.__seq__
and instance_info.conf and instance_info.conf.__plugin_id == key
then
-- exact match, return it
Expand All @@ -224,6 +225,7 @@ function get_instance_id(plugin_name, conf)
-- we're the first, put something to claim
instance_info = {
conf = conf,
seq = conf.__seq__,
}
running_instances[key] = instance_info
else
Expand All @@ -246,6 +248,7 @@ function get_instance_id(plugin_name, conf)
instance_info.id = new_instance_info.id
instance_info.plugin_name = plugin_name
instance_info.conf = new_instance_info.conf
instance_info.seq = new_instance_info.seq
instance_info.Config = new_instance_info.Config
instance_info.rpc = new_instance_info.rpc

Expand Down

0 comments on commit b829184

Please sign in to comment.