Skip to content

Commit

Permalink
feat(admin-api): add gateway edition info to the endpoint / (#12097)
Browse files Browse the repository at this point in the history
This commit is the follow-up change to the PR #12045,
since the the edition info is still useful to the kong manager, we choose to
introduce the gateway edition information in the response of the `/` endpoint.

Fix FTI-5557
  • Loading branch information
nekolab authored and AndyZhang0707 committed Jan 2, 2024
1 parent da8e44a commit a26b670
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: add gateway edition to the root endpoint of the admin api
type: feature
scope: Admin API
1 change: 1 addition & 0 deletions kong/api/routes/kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ return {
return kong.response.exit(200, {
tagline = tagline,
version = version,
edition = meta._VERSION:match("enterprise") and "enterprise" or "community",
hostname = knode.get_hostname(),
node_id = node_id,
timers = {
Expand Down
3 changes: 2 additions & 1 deletion spec/02-integration/04-admin_api/02-kong_routes_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ describe("Admin API - Kong routes with strategy #" .. strategy, function()
assert.not_nil(res.headers["X-Kong-Admin-Latency"])
end)

it("returns Kong's version number and tagline", function()
it("returns Kong's version number, edition info and tagline", function()
local res = assert(client:send {
method = "GET",
path = "/"
})
local body = assert.res_status(200, res)
local json = cjson.decode(body)
assert.equal(meta._VERSION, json.version)
assert.equal(meta._VERSION:match("enterprise") and "enterprise" or "community", json.edition)
assert.equal("Welcome to kong", json.tagline)
end)
it("returns a UUID as the node_id", function()
Expand Down

0 comments on commit a26b670

Please sign in to comment.