Hi
I’m trying to use EnvoyFilters to markup routes with filter metadata that a lua filter will later look for and use. However I’m noticing that after applying two envoyfilters that markup the same route the result is not what I was expecting.
For example, using the httpbin sample application and the filters below
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: prop1-filter
spec:
configPatches:
- applyTo: HTTP_ROUTE
match:
context: SIDECAR_INBOUND
routeConfiguration:
portNumber: 8000
patch:
operation: MERGE
value:
metadata:
filter_metadata:
envoy.lua:
prop1: "foo"
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: prop2-filter
spec:
configPatches:
- applyTo: HTTP_ROUTE
match:
context: SIDECAR_INBOUND
routeConfiguration:
portNumber: 8000
patch:
operation: MERGE
value:
metadata:
filter_metadata:
envoy.lua:
prop2: "bar"
I was expecting the resulting metadata to be
metadata:
filter_metadata:
envoy.lua:
prop1: "foo"
prop2: "bar"
However what I’m actually seeing is the second is overwriting the first resulting in
metadata:
filter_metadata:
envoy.lua:
prop2: "bar"
I’ve tried this in Istio 1.3.4 and 1.4.2 with the same result. Is this correct behaiour?
Thanks in advance.