Skip to content

Commit

Permalink
rename: declarative_config.validate -> declarative_config.validate_sc…
Browse files Browse the repository at this point in the history
…hema
  • Loading branch information
chobits committed Jan 14, 2025
1 parent 459301a commit c1a26c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions kong/clustering/services/sync/validate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local declarative_config = require("kong.db.schema.others.declarative_config")

local null = ngx.null
local tb_insert = table.insert
local validate = declarative_config.validate
local validate_schema = declarative_config.validate_schema
local pk_string = declarative_config.pk_string
local validate_references_sync = declarative_config.validate_references_sync
local pretty_print_error = declarative.pretty_print_error
Expand Down Expand Up @@ -38,10 +38,10 @@ local function validate_deltas(deltas, is_full_sync)
end
end

-- validate schema
-- validate schema (same logic as the sync v1 full-sync schema validation)
local dc_schema = db.declarative_config.schema

local ok, err_t = validate(dc_schema, dc_table)
local ok, err_t = validate_schema(dc_schema, dc_table)
if not ok then
return nil, pretty_print_error(err_t)
end
Expand Down
4 changes: 2 additions & 2 deletions kong/db/schema/others/declarative_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ local function get_unique_key(schema, entity, field, value)
end


function DeclarativeConfig.validate(self, input)
function DeclarativeConfig.validate_schema(self, input)
local ok, err = self:validate(input)
if not ok then
yield()
Expand Down Expand Up @@ -885,7 +885,7 @@ local function flatten(self, input)
input._transform = true
end

local ok, err = DeclarativeConfig.validate(self, input)
local ok, err = DeclarativeConfig.validate_schema(self, input)
if not ok then
return nil, err
end
Expand Down

0 comments on commit c1a26c0

Please sign in to comment.