From 3373feca1eedbc960d8eb230eb79f2292e99db57 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Mon, 16 Dec 2024 10:09:33 -0800 Subject: [PATCH] chore(wasm): remove bundled datakit filter (#14013) * chore(wasm): remove bundled datakit filter * change log level (cherry picked from commit f10cd09bc4c5f515c72b2987d441dc1d5a389653) --- build/openresty/wasmx/filters/variables.bzl | 14 ++------------ changelog/unreleased/kong/remove-datakit.yml | 2 ++ kong/conf_loader/init.lua | 2 +- spec/01-unit/03-conf_loader_spec.lua | 10 +++------- spec/02-integration/20-wasm/07-reports_spec.lua | 2 +- 5 files changed, 9 insertions(+), 21 deletions(-) create mode 100644 changelog/unreleased/kong/remove-datakit.yml diff --git a/build/openresty/wasmx/filters/variables.bzl b/build/openresty/wasmx/filters/variables.bzl index bb665f25fe2..1e1666a021b 100644 --- a/build/openresty/wasmx/filters/variables.bzl +++ b/build/openresty/wasmx/filters/variables.bzl @@ -2,17 +2,7 @@ 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 = [ [ @@ -20,4 +10,4 @@ WASM_FILTERS_TARGETS = [ for file in filter["files"].keys() ] for filter in WASM_FILTERS -][0] +] diff --git a/changelog/unreleased/kong/remove-datakit.yml b/changelog/unreleased/kong/remove-datakit.yml new file mode 100644 index 00000000000..4997628b6aa --- /dev/null +++ b/changelog/unreleased/kong/remove-datakit.yml @@ -0,0 +1,2 @@ +message: "**Wasm**: Removed the experimental datakit Wasm filter" +type: dependency diff --git a/kong/conf_loader/init.lua b/kong/conf_loader/init.lua index dcf7215c381..3f48010586d 100644 --- a/kong/conf_loader/init.lua +++ b/kong/conf_loader/init.lua @@ -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 diff --git a/spec/01-unit/03-conf_loader_spec.lua b/spec/01-unit/03-conf_loader_spec.lua index 10e0403d254..2fd2f98254a 100644 --- a/spec/01-unit/03-conf_loader_spec.lua +++ b/spec/01-unit/03-conf_loader_spec.lua @@ -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 = {} @@ -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() diff --git a/spec/02-integration/20-wasm/07-reports_spec.lua b/spec/02-integration/20-wasm/07-reports_spec.lua index f305bdc26d2..ccc084d24ce 100644 --- a/spec/02-integration/20-wasm/07-reports_spec.lua +++ b/spec/02-integration/20-wasm/07-reports_spec.lua @@ -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()