diff --git a/changelog/unreleased/kong/add-gateway-edition-to-root-endpoint-admin-api.yml b/changelog/unreleased/kong/add-gateway-edition-to-root-endpoint-admin-api.yml new file mode 100644 index 00000000000..a332be2ecce --- /dev/null +++ b/changelog/unreleased/kong/add-gateway-edition-to-root-endpoint-admin-api.yml @@ -0,0 +1,3 @@ +message: add gateway edition to the root endpoint of the admin api +type: feature +scope: Admin API diff --git a/kong/api/routes/kong.lua b/kong/api/routes/kong.lua index 212ddf64a82..16a2d4c7dcd 100644 --- a/kong/api/routes/kong.lua +++ b/kong/api/routes/kong.lua @@ -130,6 +130,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 = { diff --git a/spec/02-integration/04-admin_api/02-kong_routes_spec.lua b/spec/02-integration/04-admin_api/02-kong_routes_spec.lua index 66cc828503f..06e5ae65695 100644 --- a/spec/02-integration/04-admin_api/02-kong_routes_spec.lua +++ b/spec/02-integration/04-admin_api/02-kong_routes_spec.lua @@ -71,7 +71,7 @@ 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 = "/" @@ -79,6 +79,7 @@ describe("Admin API - Kong routes with strategy #" .. strategy, function() 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()