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
  • Loading branch information
flrgh authored Dec 16, 2024
1 parent 9dded31 commit f10cd09
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 23 deletions.
12 changes: 1 addition & 11 deletions build/openresty/wasmx/filters/variables.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
A list of wasm filters.
"""

WASM_FILTERS = [
{
"name": "datakit-filter",
"repo": "Kong/datakit",
"tag": "0.3.1",
"files": {
"datakit.meta.json": "acd16448615ea23315e68d4516edd79135bae13469f7bf9129f7b1139cd2b873",
"datakit.wasm": "c086e6fb36a6ed8c9ff3284805485c7280380469b6a556ccf7e5bc06edce27e7",
},
},
]
WASM_FILTERS = []

WASM_FILTERS_TARGETS = [
"@%s-%s//file" % (filter["name"], file)
Expand Down
2 changes: 0 additions & 2 deletions changelog/unreleased/kong/bump-datakit.yml

This file was deleted.

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 @@ -675,7 +675,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
12 changes: 4 additions & 8 deletions spec/01-unit/03-conf_loader_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ describe("Configuration loader", function()
assert.is_not_nil(conf)
assert.is_not_nil(conf.admin_gui_origin)
assert.same({ "http://localhost:8002" }, conf.admin_gui_origin)

conf, _, errors = conf_loader(nil, {
admin_gui_url = "http://localhost:8002/manager, https://localhost:8445/manager",
})
Expand Down Expand Up @@ -2062,12 +2062,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 @@ -2164,7 +2159,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 @@ -82,7 +82,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

1 comment on commit f10cd09

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:f10cd09bc4c5f515c72b2987d441dc1d5a389653
Artifacts available https://github.com/Kong/kong/actions/runs/12358646122

Please sign in to comment.