-
Notifications
You must be signed in to change notification settings - Fork 98
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
Generate proto files for XDS filter configs #159
Conversation
Also include debug filter proto config
@@ -0,0 +1,12 @@ | |||
syntax = "proto3"; |
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.
Can you explain why a proto for each Filter is necessary? I'm assuming this is for being able to pull config info from the XDS proto values? Mostly just want to make sure I understand what is happening here. (Also leads me into that fact we should write some docs on "writing your own filters" 😄)
Looking at Envoy, I assume this matches up to something like:
https://github.com/envoyproxy/envoy/blob/master/api/envoy/extensions/filters/http/gzip/v3/gzip.proto
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.
Yes that's the case it matches envoy's filter proto files. XDS has a filter chain proto message that's a list of these config messages one per filter. Then on our end after receiving we transform that XDS filter chain into our own e32fb6d#diff-07a585ddcc9ea470eb22742d985007bb1483e42bafd05d660ed3ec5294cdb1d0R142-R154
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
option go_package = "example"; |
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.
If we are going to have a go_package, probably makes sense to have it be a package other than "example"?
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.
Will fix, it was left over from local testing
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.
Removed
@@ -33,13 +33,34 @@ mod envoy { | |||
tonic::include_proto!("envoy.r#type.matcher.v3"); | |||
} | |||
} | |||
pub mod metadata { |
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.
Random thought - this seems like a lot of boilerplate. Macro time?
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.
That could be the case, not sure what a macro here would look like and I don't think it'll be trivial to write if possible, since the heirarchies are arbitrarily nested and the macro would need to figure out where each include
goes and how to split the raw string to figure out the module components
Also include debug filter proto config