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(wasm): include configuration in initial load #10436

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions kong/runloop/wasm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,26 @@ function _M.init_worker()
return true
end

local c_ops, err = proxy_wasm.new(all_filters)
if err then
local filters = {}
for chain, err in kong.db.wasm_filter_chains:each() do
if err then
return nil, "failed initial filter chain setup: " .. tostring(err)
end

for _, filter in ipairs(chain.filters) do
table.insert(filters, {
name = filter.name,
config = filter.config,
})
end
end

if #filters == 0 then
return true
end

local c_ops, err = proxy_wasm.new(filters)
if not c_ops then
return nil, "proxy wasm module instantiation failed: " .. tostring(err)
end

Expand Down