diff --git a/kong/conf_loader/init.lua b/kong/conf_loader/init.lua index a7d9497e9c6..9d004438e16 100644 --- a/kong/conf_loader/init.lua +++ b/kong/conf_loader/init.lua @@ -436,7 +436,7 @@ local CONF_INFERENCES = { } }, router_flavor = { - enum = { "traditional", "traditional_compatible", "atc" }, + enum = { "traditional", "traditional_compatible", "expressions" }, }, worker_state_update_frequency = { typ = "number" }, diff --git a/kong/db/migrations/core/016_280_to_300.lua b/kong/db/migrations/core/016_280_to_300.lua index 9264ac4a83e..45dfe20c625 100644 --- a/kong/db/migrations/core/016_280_to_300.lua +++ b/kong/db/migrations/core/016_280_to_300.lua @@ -305,7 +305,7 @@ return { DO $$ BEGIN - ALTER TABLE IF EXISTS ONLY "routes" ADD COLUMN "atc" TEXT; + ALTER TABLE IF EXISTS ONLY "routes" ADD COLUMN "expression" TEXT; EXCEPTION WHEN duplicate_column THEN -- Do nothing, accept existing state END; @@ -391,7 +391,7 @@ return { -- add new hash_fallback_uri_capture field to upstreams ALTER TABLE upstreams ADD hash_fallback_uri_capture text; - ALTER TABLE routes ADD atc text; + ALTER TABLE routes ADD expression text; ALTER TABLE routes ADD priority int; ]], diff --git a/kong/db/schema/entities/routes.lua b/kong/db/schema/entities/routes.lua index b6b33979f1b..3f8c65e2c83 100644 --- a/kong/db/schema/entities/routes.lua +++ b/kong/db/schema/entities/routes.lua @@ -3,7 +3,7 @@ local atc = require("kong.router.atc") local router = require("resty.router.router") -if kong and kong.configuration and kong.configuration.router_flavor == "atc" then +if kong and kong.configuration and kong.configuration.router_flavor == "expressions" then return { name = "routes", primary_key = { "id" }, @@ -37,20 +37,20 @@ if kong and kong.configuration and kong.configuration.router_flavor == "atc" the { response_buffering = { type = "boolean", required = true, default = true }, }, { tags = typedefs.tags }, { service = { type = "foreign", reference = "services" }, }, - { atc = { type = "string", required = true }, }, + { expression = { type = "string", required = true }, }, { priority = { type = "integer", required = true, default = 0 }, }, }, entity_checks = { { custom_entity_check = { - field_sources = { "atc", "id", }, + field_sources = { "expression", "id", }, fn = function(entity) local s = atc.get_schema() local r = router.new(s) - local res, err = r:add_matcher(0, entity.id, entity.atc) + local res, err = r:add_matcher(0, entity.id, entity.expression) if not res then - return nil, "DSL failed validation: " .. err + return nil, "Router Expression failed validation: " .. err end return true diff --git a/kong/db/schema/entities/routes_subschemas.lua b/kong/db/schema/entities/routes_subschemas.lua index 5e351706346..dcc35e6f8a9 100644 --- a/kong/db/schema/entities/routes_subschemas.lua +++ b/kong/db/schema/entities/routes_subschemas.lua @@ -66,7 +66,7 @@ local grpc_subschema = { } -if kong and kong.configuration and kong.configuration.router_flavor == "atc" then +if kong and kong.configuration and kong.configuration.router_flavor == "expressions" then return {} else diff --git a/kong/router/atc_compat.lua b/kong/router/atc_compat.lua index 4a575035bdf..82e6e4dd8f0 100644 --- a/kong/router/atc_compat.lua +++ b/kong/router/atc_compat.lua @@ -410,7 +410,7 @@ function _M.new(routes, cache, cache_neg) assert(inst:add_matcher(route_priority(route), route_id, get_atc(route))) else - local atc = route.atc + local atc = route.expression local gen = gen_for_field("net.protocol", OP_EQUAL, route.protocols) if gen then