Skip to content

Commit

Permalink
chore(wasm): remove bundled datakit filter (#14013)
Browse files Browse the repository at this point in the history
* chore(wasm): remove bundled datakit filter

* change log level

(cherry picked from commit f10cd09)
  • Loading branch information
flrgh authored and ms2008 committed Jan 14, 2025
1 parent a6f8e47 commit d506d8a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
14 changes: 2 additions & 12 deletions build/openresty/wasmx/filters/variables.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@
A list of wasm filters.
"""

WASM_FILTERS = [
{
"name": "datakit-filter",
"repo": "Kong/datakit-filter",
"tag": "0.1.0",
"files": {
"datakit.meta.json": "b9f3b6d51d9566fae1a34c0e5c00f0d5ad5dc8f6ce7bf81931fd0be189de205d",
"datakit.wasm": "a494c254915e222c3bd2b36944156680b4534bdadf438fb2143df9e0a4ef60ad",
},
},
]
WASM_FILTERS = []

WASM_FILTERS_TARGETS = [
[
"@%s//file" % file
for file in filter["files"].keys()
]
for filter in WASM_FILTERS
][0]
]
2 changes: 2 additions & 0 deletions changelog/unreleased/kong/remove-datakit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
message: "**Wasm**: Removed the experimental datakit Wasm filter"
type: dependency
2 changes: 1 addition & 1 deletion kong/conf_loader/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ local function load(path, custom_conf, opts)
bundled_filter_path = alt_path

else
log.warn("Bundled proxy-wasm filters path (%s) does not exist " ..
log.debug("Bundled proxy-wasm filters path (%s) does not exist " ..
"or is not a directory. Bundled filters may not be " ..
"available", bundled_filter_path)
end
Expand Down
10 changes: 3 additions & 7 deletions spec/01-unit/03-conf_loader_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1977,12 +1977,7 @@ describe("Configuration loader", function()
}))

assert(conf.wasm_bundled_filters_path)
bundled_filters = {
{
name = "datakit",
path = conf.wasm_bundled_filters_path .. "/datakit.wasm",
},
}
bundled_filters = {}
end

all_filters = {}
Expand Down Expand Up @@ -2079,7 +2074,8 @@ describe("Configuration loader", function()
assert.same(bundled_filters, conf.wasm_modules_parsed)
end)

it("prefers user filters to bundled filters when a conflict exists", function()
-- XXX: we don't have any bundled filters to use for this test
pending("prefers user filters to bundled filters when a conflict exists", function()
local user_filter = temp_dir .. "/datakit.wasm"
assert(helpers.file.write(user_filter, "I'm a happy little wasm filter"))
finally(function()
Expand Down
2 changes: 1 addition & 1 deletion spec/02-integration/20-wasm/07-reports_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ for _, strategy in helpers.each_strategy() do
local _, reports_data = assert(reports_server:join())
reports_data = cjson.encode(reports_data)

assert.match("wasm_cnt=3", reports_data)
assert.match("wasm_cnt=2", reports_data)
end)

it("logs number of requests triggering a Wasm filter", function()
Expand Down

0 comments on commit d506d8a

Please sign in to comment.