-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add XDS Filter implementation #171
Conversation
Adds filter manager logic to listen for LDS resources and construct filter chains from them. This required moving some common setup out of the current CDS listener. Does not update the proxy to use the filter chain from the filter manager - follow up PR will do this. Work on #10
src/extensions/filters/debug.rs
Outdated
&self, | ||
config: Option<prost_types::Any>, | ||
) -> Result<Box<dyn Filter>, Error> { | ||
let config = config.ok_or_else(|| Error::MissingConfig)?; |
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.
Debug
has an optional id
so if it doesn't exist we can return a Debug::new(&self.log, None)
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.
Fixed!
src/proxy/server/resource_manager.rs
Outdated
@@ -0,0 +1,201 @@ | |||
/* | |||
* Copyright 2020 Google LLC All Rights Reserved. |
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.
heh, new files should be 2021 😄
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.
Fixed!
src/proxy/server/resource_manager.rs
Outdated
&mut shutdown_rx, | ||
) | ||
.await?; | ||
info!(log, "Received initial filter chain update."); |
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.
Should these info! be debug! ?
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.
Done!
src/xds/listener.rs
Outdated
.await | ||
.map_err(|err| err.message); | ||
|
||
println!("processed listener reponse: is ok? = {:?}", result.is_ok()); |
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.
Did you leave this in after debugging? 😄
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!
193c20a
to
83e983e
Compare
Ooh, lots of conflicts. Can you clean this up, and I'll give it another review tomorrow 👍 |
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.
Sweet!
*/ | ||
|
||
// TODO: Allow unused variables since this module is WIP. | ||
#![allow(unused)] |
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.
Not for this PR, but should we remove the deny warnings:
https://www.reddit.com/r/rust/comments/f5xpib/psa_denywarnings_is_actively_harmful/
We could move the check into CI though. WDYT?
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 this makes sense to do! Will create a ticket
mod resource_manager; | ||
|
||
// Stub module to work-around not including XDS generated code in doc tests. | ||
#[cfg(doctest)] |
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.
Not for this PR, but does this config feature help here? (you understand doc tests better than I do)
https://docs.rs/prost-build/0.7.0/prost_build/struct.Config.html#method.disable_comments
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.
Ah this is no longer needed since we remove the workaround in main, will remove!
Adds filter manager logic to listen for LDS resources and
construct filter chains from them.
This required moving some common setup out of the current CDS listener.
Does not update the proxy to use the filter chain from the
filter manager - follow up PR will do this.
Work on #10