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
)
  • Loading branch information
gszr authored Mar 13, 2024
1 parent 6461d24 commit 97c2651
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

1 comment on commit 97c2651

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:97c265176959a463e2e60931f0274ff627ced554
Artifacts available https://github.com/Kong/kong/actions/runs/8266170594

Please sign in to comment.