Skip to content
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

Merged
merged 3 commits into from
Dec 15, 2020
Merged

Conversation

iffyio
Copy link
Collaborator

@iffyio iffyio commented Dec 10, 2020

Also include debug filter proto config

Also include debug filter proto config
@iffyio iffyio requested a review from markmandel December 10, 2020 17:14
@google-cla google-cla bot added the cla: yes label Dec 10, 2020
@@ -0,0 +1,12 @@
syntax = "proto3";
Copy link
Contributor

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

Copy link
Collaborator Author

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";
Copy link
Contributor

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"?

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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 {
Copy link
Contributor

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?

Copy link
Collaborator Author

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

@markmandel markmandel added area/build-tools Development tooling. kind/feature New feature or request labels Dec 15, 2020
@markmandel markmandel merged commit 3653b1e into master Dec 15, 2020
@markmandel markmandel deleted the iu/filter-proto branch December 15, 2020 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. cla: yes kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants