ext_proc: allow override metadata without grpc_service#31544
ext_proc: allow override metadata without grpc_service#31544yanavlasov merged 15 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
Other considerations:
Another PR working on ext_proc metadata, but unrelated: #30747 |
|
Also, I have full grpc exp_proc example in https://github.com/sitano/envoy/tree/ivan_api_502/examples/grpc-bridge which I would like to add too, but it will a bit more effort to polish and I think its worth putting it into a separate PR. Or we can add it here? |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks!
Left an API high-level comment.
Please note that this PR will be reviewed after marking it as non-draft (otherwise the reviewers may not be notified on its changes).
46b7dbb to
f45a200
Compare
allows `overrides.metadata` in `ExtProcPerRoute` that appends and
overrides parent metadata:
- match:
...
route:
...
typed_per_filter_config:
envoy.filters.http.ext_proc:
"@type": type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute
overrides:
metadata:
- key: "x-ext-proc-override"
value: "route3-override"
- key: "x-router3-metadata-append"
value: "route3-metadata-append"
http_filters:
- name: envoy.filters.http.ext_proc
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
grpc_service:
envoy_grpc:
cluster_name: ext-proc-proxy
timeout: 60s
initial_metadata:
- key: "x-ext-proc-override"
value: "root"
- key: "x-ext-proc-original"
value: "root"
that allows to have:
x-ext-proc-override: route3-override
x-router3-metadata-append: route3-metadata-append
x-ext-proc-original: root
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
- TEST(OverrideTest, MetadataOverride)
- TEST_F(HttpFilterTest, GrpcServiceMetadataOverride)
- TEST_P(ExtProcIntegrationTest, PerRouteMetadata)
$ bazel test //test/extensions/filters/http/ext_proc:config_test --config=clang --verbose_failures --test_arg="-l trace"
$ bazel test //test/extensions/filters/http/ext_proc:filter_test --config=clang --verbose_failures --test_arg="-l trace"
$ bazel test //test/extensions/filters/http/ext_proc:ext_proc_integration_test --config=clang --verbose_failures --test_arg=--gtest_filter='*/ExtProcIntegrationTest.PerRouteMetadata/*' --test_arg="-l trace"
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
f45a200 to
143ef4a
Compare
|
This test It is ready for review. The PR touches the same areas as the aforementioned #30747 and it could be easier for the same reviewers to do the review as they already are familiar with the ext_proc code base. |
|
Added reviewer and approver from #30747 as suggested. |
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com> Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
|
LGTM from me. I will wait for API LGTM. /wait-any |
There was a problem hiding this comment.
@sitano Just one high-level question, Can I understand as follow?
Before this PR, ext_proc overrides whole grpc_service
with this PR, you want to only overrides initial_metadata of the grpc_service, rather than whole gRPC_service
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
|
list of additional changes in this
|
|
I think this also has the issue I point to in #32125 (comment). I'm not sure if we want to have multiple different ways to do the same thing - when to use metadata vs. attributes? They both sound like words for OOB properties, is it possible to formally state when you would use one vs the other? CC @rshriram |
If I understand the point in 32125 the question is that existing attributes are not flexible enough and serve the same goal as metadata. I also think it is better to only have 1 thing. However, I would expect we can not deprecate the metadata from the grpc_service - it is used in many other places. Then why extend attributes functionality? It looks like it makes sense but it is out of the scope of this PR.
in this PR we are only providing a way to extend grpc service initial_metadata on per route basis. |
|
EDIT of last msg:
|
|
@htuch I'm not clear on the status of tihs PR. is it awaiting review or waiting on offline discussion? |
|
As initial metadata stays as per #32125 (comment) I think we can proceed? |
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
|
I'm also confused about the primary approver for this PR. @yanavlasov @htuch @rshriram let's clarify the status, is this mostly ready and awaiting for nits, or major changes needed. |
|
API LGTM, handing back to @yanavlasov for implementation review and merge. |
Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
|
@yanavlasov I am not sure if we would like to have it merged, but just pinging you because > yanavlasov requested changes, and there are no changes actually to do |
Commit Message:
ext_proc: allow override metadata without grpc_serviceThe patch introduces
overrides.grpc_initial_metadatainExtProcPerRoute.overridesthat appends and overrides parent metadata:that allows to have:
like the following:
Additional Description:
new ext_proc per route override of inherited grpc metadata without specifying grpc_serviceRisk Level: low
Testing: Unit, Integration, Config
Docs Changes: will have to update https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ext_proc/v3/ext_proc.proto#extensions-filters-http-ext-proc-v3-extprocperroute regarding
repeated config.core.v3.HeaderValue grpc_initial_metadata = 7;.Release Notes: see
changlelogs/current.yamlPlatform Specific Features: -
Testing
Test infrastructure https://github.com/sitano/envoy/tree/ivan_api_502/examples/grpc-bridge:
Example