Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runloop): added the workspace id into the plugin config in the plugins iterator #13602

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/unreleased/kong/feat-plugin-conf-ws-id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: Added the workspace id into the plugin config in the plugins iterator.
type: feature
scope: Core
1 change: 1 addition & 0 deletions kong/runloop/plugins_iterator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ local function get_plugin_config(plugin, name, ws_id)
cfg.consumer_id = plugin.consumer and plugin.consumer.id
cfg.plugin_instance_name = plugin.instance_name
cfg.__plugin_id = plugin.id
cfg.__ws_id = ws_id

local key = kong.db.plugins:cache_key(name,
cfg.route_id,
Expand Down
1 change: 1 addition & 0 deletions spec/02-integration/07-sdk/04-plugin-config_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ describe("Plugin configuration", function()
local body = assert.status(200, res)
local json = cjson.decode(body)
assert.equal("test", json.plugin_instance_name)
assert.equal(kong.default_workspace, json.__ws_id)
end)
end)
Loading