Skip to content

Commit a26b670

Browse files
nekolabAndyZhang0707
authored andcommitted
feat(admin-api): add gateway edition info to the endpoint / (#12097)
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
1 parent da8e44a commit a26b670

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
message: add gateway edition to the root endpoint of the admin api
2+
type: feature
3+
scope: Admin API

kong/api/routes/kong.lua

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ return {
106106
return kong.response.exit(200, {
107107
tagline = tagline,
108108
version = version,
109+
edition = meta._VERSION:match("enterprise") and "enterprise" or "community",
109110
hostname = knode.get_hostname(),
110111
node_id = node_id,
111112
timers = {

spec/02-integration/04-admin_api/02-kong_routes_spec.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ describe("Admin API - Kong routes with strategy #" .. strategy, function()
6969
assert.not_nil(res.headers["X-Kong-Admin-Latency"])
7070
end)
7171

72-
it("returns Kong's version number and tagline", function()
72+
it("returns Kong's version number, edition info and tagline", function()
7373
local res = assert(client:send {
7474
method = "GET",
7575
path = "/"
7676
})
7777
local body = assert.res_status(200, res)
7878
local json = cjson.decode(body)
7979
assert.equal(meta._VERSION, json.version)
80+
assert.equal(meta._VERSION:match("enterprise") and "enterprise" or "community", json.edition)
8081
assert.equal("Welcome to kong", json.tagline)
8182
end)
8283
it("returns a UUID as the node_id", function()

0 commit comments

Comments
 (0)