-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(clustering/sync): validate deltas #14127
base: master
Are you sure you want to change the base?
Conversation
if delta_entity ~= nil and delta_entity ~= ngx.null then | ||
dc_table[delta_type] = dc_table[delta_type] or {} | ||
|
||
table.insert(dc_table[delta_type], delta_entity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localize table.insert
?
|
||
-- table: primary key string -> entity | ||
if not is_full_sync then | ||
local schema = kong.db[delta_type].schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localize kong.db
in function?
|
||
local foreign_refs = foreign_references[item_type] | ||
|
||
if not item or item == ngx.null or not foreign_refs then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localize ngx.null
?
local pks = DeclarativeConfig.pk_string(db.schema, v) | ||
local fvalue = deltas_map[pks] | ||
if fvalue then | ||
goto found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be break
?
@@ -506,6 +507,71 @@ local function validate_references(self, input) | |||
end | |||
|
|||
|
|||
function DeclarativeConfig.validate_references_full(self, input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the parameter is call self
? I think that DeclarativeConfig
has no method new()
to create instance.
Summary
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix KAG-5897