Skip to content
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(migrations) don't assume '/?/init.lua' in the path #6993

Merged
merged 2 commits into from
May 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions kong/db/migrations/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ local function load_subsystems(db, plugin_names)
local namespace = ss.namespace:gsub("%*", plugin_name)

local ok, mig_idx = utils.load_module_if_exists(namespace)

if not ok then
-- fallback to using ".init" since "/?/init.lua" isn't always in a
-- Lua-path by default, see https://github.com/Kong/kong/issues/6867
ok, mig_idx = utils.load_module_if_exists(namespace .. ".init")
end

if ok then
if type(mig_idx) ~= "table" then
return nil, fmt_err(db, "migrations index from '%s' must be a table",
Expand Down