Skip to content

Commit

Permalink
Use proper well-known name for the HTTP filter. (envoyproxy#169)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
  • Loading branch information
PiotrSikora committed Aug 29, 2019
1 parent f8d987f commit 9049962
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/wasm/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static_resources:
route:
cluster: web_service
http_filters:
- name: envoy.wasm
- name: envoy.filters.http.wasm
config:
vm_id: "my_vm_id"
root_id: "my_root_id"
Expand Down
9 changes: 5 additions & 4 deletions source/extensions/common/wasm/null/sample_plugin/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ void PluginContext::onLog() {
logWarn("request.path: " + getSelectorExpression({"request", "path"}).value()->toString());
logWarn("node.metadata: " +
getSelectorExpression({"node", "metadata", "istio.io/metadata"}).value()->toString());
logWarn("metadata: " + getSelectorExpression({"metadata", "filter_metadata", "envoy.wasm",
"wasm_request_get_key"})
.value()
->toString());
logWarn("metadata: " +
getSelectorExpression(
{"metadata", "filter_metadata", "envoy.filters.http.wasm", "wasm_request_get_key"})
.value()
->toString());
auto responseCode = getSelectorExpression({"response", "code"}).value();
if (responseCode->size() == sizeof(int64_t)) {
char buf[sizeof(int64_t)];
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/filters/http/well_known_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class HttpFilterNameValues {
const std::string OriginalSrc = "envoy.filters.http.original_src";
// Dynamic forward proxy filter
const std::string DynamicForwardProxy = "envoy.filters.http.dynamic_forward_proxy";
// Wasm filter
const std::string Wasm = "envoy.wasm";
// WebAssembly filter
const std::string Wasm = "envoy.filters.http.wasm";

// Converts names from v1 to v2
const Config::V1Converter v1_converter_;
Expand Down
6 changes: 3 additions & 3 deletions test/extensions/filters/http/wasm/wasm_filter_stress_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TEST_P(GrpcWasmStressTest, CalloutHappyPath) {
//

config_helper_.addFilter(fmt::format(R"EOF(
name: envoy.wasm
name: envoy.filters.http.wasm
config:
vm_config:
vm: "{}"
Expand Down Expand Up @@ -180,7 +180,7 @@ TEST_P(GrpcWasmStressTest, CalloutErrorResponse) {
//

config_helper_.addFilter(fmt::format(R"EOF(
name: envoy.wasm
name: envoy.filters.http.wasm
config:
vm_config:
vm: "{}"
Expand Down Expand Up @@ -290,7 +290,7 @@ TEST_P(HttpWasmStressTest, DISABLED_CalloutHappyPath) {
//

config_helper_.addFilter(fmt::format(R"EOF(
name: envoy.wasm
name: envoy.filters.http.wasm
config:
vm_config:
vm: "{}"
Expand Down

0 comments on commit 9049962

Please sign in to comment.