-
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
fix(db/migration): do migration before validation #10348
Conversation
ae59e39
to
1acd47f
Compare
if not routes then | ||
-- no need to migrate | ||
return | ||
local function table_default(val) |
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.
table_or_default
or get_valid_table
may be a better name.
Perhaps we should cherry-pick this PR to the 3.2 release branch. |
We choose to only handle nesting in top-level services. Fix KAG-638 Co-authored-by: Chrono <chrono_cpp@me.com> fix lint
7e75cbb
to
227b5ee
Compare
Co-authored-by: Chrono <chrono_cpp@me.com>
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.
Some comments, am I right about these?
@@ -82,6 +82,8 @@ | |||
[#10346](https://github.com/Kong/kong/pull/10346) | |||
- Fix an issue where control plane does not rename fields correctly for `session` for older version of data planes. | |||
[#10352](https://github.com/Kong/kong/pull/10352) | |||
- Fix an issue where validation to regex routes may be skipped when the old-fashioned config is used for DB-less Kong. |
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.
- Fix an issue where validation to regex routes may be skipped when the old-fashioned config is used for DB-less Kong. | |
- Fix an issue where migration to regex routes may be skipped when the old-fashioned config is used for DB-less Kong. |
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.
No. It's not the migration being skipped. The migration will happen anyway.
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.
So the issue is about validation being skipped? Aka it should fail validation, but now it does not fail? I tought it was about migrating also service nested routes that was not done before.
return | ||
local function table_default(val) | ||
-- we cannot verify it with type(val) == "table" because | ||
-- we may recieve indexable cdata/lightuserdata |
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.
-- we may recieve indexable cdata/lightuserdata
When and why would this happen?
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.
The caller may pass an object representing yaml/json object, which could be wrapped c object.
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.
For the same reason, I'm using pairs instead of pairs. But let's give it a try and revert if it fails.
Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
Co-authored-by: Chrono <chrono_cpp@me.com> Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com> Co-authored-by: Enrique García Cota <kikito@gmail.com> (cherry picked from commit 2f82ced)
Co-authored-by: Chrono <chrono_cpp@me.com> Co-authored-by: Aapo Talvensaari <aapo.talvensaari@gmail.com> Co-authored-by: Enrique García Cota <kikito@gmail.com> (cherry picked from commit 2f82ced)
Summary
We choose to only handle nesting in top-level services.
Checklist
N/A There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE
Issue reference
Fix KAG-638