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

Add XDS Filter implementation #171

Merged
merged 7 commits into from
Feb 5, 2021
Merged

Add XDS Filter implementation #171

merged 7 commits into from
Feb 5, 2021

Conversation

iffyio
Copy link
Collaborator

@iffyio iffyio commented Jan 22, 2021

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

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
@google-cla google-cla bot added the cla: yes label Jan 22, 2021
@markmandel markmandel added the kind/feature New feature or request label Jan 27, 2021
src/extensions/filter_manager.rs Show resolved Hide resolved
src/extensions/filter_registry.rs Outdated Show resolved Hide resolved
&self,
config: Option<prost_types::Any>,
) -> Result<Box<dyn Filter>, Error> {
let config = config.ok_or_else(|| Error::MissingConfig)?;
Copy link
Member

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

src/extensions/filters/debug.rs Outdated Show resolved Hide resolved
@@ -0,0 +1,201 @@
/*
* Copyright 2020 Google LLC All Rights Reserved.
Copy link
Member

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 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

&mut shutdown_rx,
)
.await?;
info!(log, "Received initial filter chain update.");
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

src/proxy/server/resource_manager.rs Show resolved Hide resolved
src/xds/listener.rs Show resolved Hide resolved
.await
.map_err(|err| err.message);

println!("processed listener reponse: is ok? = {:?}", result.is_ok());
Copy link
Member

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

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!

Base automatically changed from master to main January 27, 2021 16:31
@markmandel
Copy link
Member

Ooh, lots of conflicts. Can you clean this up, and I'll give it another review tomorrow 👍

Copy link
Member

@markmandel markmandel left a 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)]
Copy link
Member

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?

Copy link
Collaborator Author

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)]
Copy link
Member

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

Copy link
Collaborator Author

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!

@markmandel markmandel merged commit b423ca1 into main Feb 5, 2021
@markmandel markmandel deleted the iu/xds-filter-impl branch February 5, 2021 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants