-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Allow http route and cluster metadata to contain typed metadata in An… #16107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yanavlasov
merged 22 commits into
envoyproxy:main
from
yanjunxiang-google:metadata_proto
May 18, 2021
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7a11210
Allow http route and cluster metadata to contain typed metadata in An…
yanjunxiang-google c997e15
Update PR based on comments
yanjunxiang-google 6276b4d
update diff based on comments
yanjunxiang-google 2ab8508
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 82d73eb
Revert "Update PR based on comments"
yanjunxiang-google 009ede2
update change based on comments-remove unnecessary changes generated …
yanjunxiang-google 1673473
fix spelling error
yanjunxiang-google 97986c0
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 8936371
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 6d62272
commit the generated v4alpha proto files
yanjunxiang-google b48a943
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 91e31bc
adding back the two missed test file changes
yanjunxiang-google c5254db
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 03500dc
adding change to deal with pre_submit check error flaged by gcc
yanjunxiang-google c21cb0b
merge upstream/main
yanjunxiang-google 4042f5d
run fix_and_check scripts
yanjunxiang-google 7b22234
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 9d8d04f
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google e59b4c4
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google d2b51da
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google 4767834
address comments regarding base.proto document format
yanjunxiang-google 33bb388
Merge branch 'main' of https://github.com/envoyproxy/envoy into metad…
yanjunxiang-google File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments here.
You might also want to update the comment for the
Metadatamessage to describe the differences between the typed and non-typed filter metadata fields.In addition, can the same key be in both
filter_metadataandtyped_filter_metadata. If so, what happens in this case?BTW: if there should only be either
filter_metadataortyped_filter_metadatabut not both, then consider usingoneofhere.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question here is shall we deprecate
filter_metadata? When we changed filter configs from Struct to Any we deprecated Struct because Any can have Struct in it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mark it as deprecated.
I think Oneof will make it harder to migrate.
For now we need both to have a smooth migration: let the metadata impl first look at typed_filter_metadata and fallback to typed_metadata when it's not populated. This way we can decouple dataplane with control plane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah don't make it oneof, it breaks the compatibility on generated codes and violates our API policy.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Oneof is infeasible here. For Oneof fields, "You can add fields of any type, except map fields and repeated fields." See https://developers.google.com/protocol-buffers/docs/proto3#oneof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main present issue with transitioning to using
Struct-inside-of-Anyis that the Metadata utility class has static methods only. It will be inefficient to use with theStruct-inside-of-Anyas there is no way to cache parsed Struct. The Metadata utility class is used heavily within Envoy and also by proprietary filters, so changing its API will be challenging.One potential way forward is to make current implementation of the Metadata class inefficient with respect to
Struct-inside-of-Anyand mark it as deprecated to prevent further use. And then add a new class that can cache parsed Struct from Any.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think a
TypedMetadataclass would make sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments. Based on the discussion, I put Struct as deprecated, and added Any. Please take a look the latest code change and let me know whether this look good to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Struct field being deprecated, this pre_submit check scripts: " ci/run_envoy_docker.sh 'ci/do_ci.sh bazel.compile_time_options' ", is complaining below and failed the check constantly:
2021-05-07T23:34:58.2181735Z C++ exception with description "type envoy.config.core.v3.Metadata Using deprecated option 'envoy.config.core.v3.Metadata.filter_metadata' from file base.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override." thrown in the test body.
2021-05-07T23:34:58.2184225Z [ FAILED ] OmitHostsRetryPredicateTest.PredicateTest (22 ms)
This happend on a lot of test cases, and one scripts run only report some of them. Once some test cases are failed as above, I just use DEPRECATED_FEATURE_TEST() to guard them. Another scripts run will report new ones. I have below questions:
Please let me know your opinion.
Thanks!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of test cases broken by deprecating Struct field. Fixing those test cases need time. Given the timing pressure for adding Any support in this protobuf, we decided to tackle Struct field deprecation and fixing the related test cases in a separate PR.
Please let me know whether this sound good to you.