Skip to content

Commit

Permalink
feat(api) report plugin versions on server (#8810)
Browse files Browse the repository at this point in the history
* feat(api) report plugin versions on server
* add changelog entry
* update to object containing version: this allows for easier extension later, without breaking changes
  • Loading branch information
Tieske committed May 19, 2022
1 parent fba1993 commit 6558e99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
when updating to Kong 3.0.
- Insert and update operations on duplicated target entities returns 409.
[#8179](https://github.com/Kong/kong/pull/8179)
- The list of reported plugins available on the server now returns a table of
metadata per plugin instead of a boolean `true`.
[#8810](https://github.com/Kong/kong/pull/8810)

#### PDK

Expand Down
13 changes: 10 additions & 3 deletions kong/api/routes/kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,25 @@ return {
ngx.log(ngx.ERR, "could not get node id: ", err)
end

local available_plugins = {}
for name in pairs(singletons.configuration.loaded_plugins) do
available_plugins[name] = {
version = kong.db.plugins.handlers[name].VERSION or true
}
end

return kong.response.exit(200, {
tagline = tagline,
version = version,
hostname = knode.get_hostname(),
node_id = node_id,
timers = {
running = ngx.timer.running_count(),
pending = ngx.timer.pending_count()
pending = ngx.timer.pending_count(),
},
plugins = {
available_on_server = singletons.configuration.loaded_plugins,
enabled_in_cluster = distinct_plugins
available_on_server = available_plugins,
enabled_in_cluster = distinct_plugins,
},
lua_version = lua_version,
configuration = conf_loader.remove_sensitive(singletons.configuration),
Expand Down

0 comments on commit 6558e99

Please sign in to comment.