-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade goks to use Kong Gateway 3.4.0
- Loading branch information
Showing
14 changed files
with
470 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
patches/003_lua-tree_share_lua_5_1_kong_db_schema_entities_plugins_lua.patch
This file was deleted.
Oops, something went wrong.
79 changes: 76 additions & 3 deletions
79
patches/004_lua-tree_share_lua_5_1_kong_db_schema_entities_routes_lua.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,89 @@ | ||
diff --git a/lua-tree/share/lua/5.1/kong/db/schema/entities/routes.lua b/lua-tree/share/lua/5.1/kong/db/schema/entities/routes.lua | ||
index db0696f..da85443 100644 | ||
index 5c98e39..c1a346b 100644 | ||
--- a/lua-tree/share/lua/5.1/kong/db/schema/entities/routes.lua | ||
+++ b/lua-tree/share/lua/5.1/kong/db/schema/entities/routes.lua | ||
@@ -1,9 +1,8 @@ | ||
@@ -1,35 +1,8 @@ | ||
local typedefs = require("kong.db.schema.typedefs") | ||
-local atc = require("kong.router.atc") | ||
-local router = require("resty.router.router") | ||
local deprecation = require("kong.deprecation") | ||
|
||
-local validate_route | ||
-local has_paths | ||
-do | ||
- local isempty = require("table.isempty") | ||
- local CACHED_SCHEMA = require("kong.router.atc").schema | ||
- local get_expression = require("kong.router.compat").get_expression | ||
- | ||
- local type = type | ||
- | ||
- -- works with both `traditional_compatiable` and `expressions` routes` | ||
- validate_route = function(entity) | ||
- local exp = entity.expression or get_expression(entity) | ||
- | ||
- local ok, err = router.validate(CACHED_SCHEMA, exp) | ||
- if not ok then | ||
- return nil, "Router Expression failed validation: " .. err | ||
- end | ||
- | ||
- return true | ||
- end | ||
- | ||
- has_paths = function(entity) | ||
- local paths = entity.paths | ||
- return type(paths) == "table" and not isempty(paths) | ||
- end | ||
-end | ||
- | ||
-local kong_router_flavor = kong and kong.configuration and kong.configuration.router_flavor | ||
+-- ATC router is incompatible with goks | ||
+local kong_router_flavor = "traditional" | ||
|
||
if kong_router_flavor == "expressions" then | ||
return { | ||
@@ -70,20 +43,6 @@ if kong_router_flavor == "expressions" then | ||
{ expression = { description = " The router expression.", type = "string", required = true }, }, | ||
{ priority = { description = "A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.", type = "integer", required = true, default = 0 }, }, | ||
}, | ||
- | ||
- entity_checks = { | ||
- { custom_entity_check = { | ||
- field_sources = { "expression", "id", }, | ||
- fn = function(entity) | ||
- local ok, err = validate_route(entity) | ||
- if not ok then | ||
- return nil, err | ||
- end | ||
- | ||
- return true | ||
- end, | ||
- } }, | ||
- }, | ||
} | ||
|
||
-- router_flavor in ('traditional_compatible', 'traditional') | ||
@@ -122,25 +81,6 @@ else | ||
}}, | ||
} | ||
|
||
- if kong_router_flavor == "traditional_compatible" then | ||
- table.insert(entity_checks, | ||
- { custom_entity_check = { | ||
- run_with_missing_fields = true, | ||
- field_sources = { "id", "paths", }, | ||
- fn = function(entity) | ||
- if has_paths(entity) then | ||
- local ok, err = validate_route(entity) | ||
- if not ok then | ||
- return nil, err | ||
- end | ||
- end | ||
- | ||
- return true | ||
- end, | ||
- }} | ||
- ) | ||
- end | ||
- | ||
return { | ||
name = "routes", | ||
primary_key = { "id" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.