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.
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
xds: listener type validation #11933
xds: listener type validation #11933
Changes from 16 commits
4eb625a
ad90963
01927a6
8780c52
76270a4
da0d5ab
ba8af22
694c2f1
506bbe4
87aad6f
239f167
ca5bb14
cb41652
e07158f
9f79e8c
d8fb13a
6873d59
b3908f1
4dc1039
3a36c2d
f82d899
eee4ea9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Add unit test in GrpcXdsClientImplDataTest.
Check warning on line 170 in xds/src/main/java/io/grpc/xds/XdsListenerResource.java
xds/src/main/java/io/grpc/xds/XdsListenerResource.java#L170
Check warning on line 174 in xds/src/main/java/io/grpc/xds/XdsListenerResource.java
xds/src/main/java/io/grpc/xds/XdsListenerResource.java#L174
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.
Add unit test in GrpcXdsClientImplDataTest.
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.
Add unit test for when the listener update is missing httpConnectionManager.
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.
nit: this
error
string is never reused, thus no need to store it in a local variable.We can simply rewrite as
logger.log(XdsLogLevel.INFO, "API Listener: httpConnectionManager does not exist.");
Check warning on line 684 in xds/src/main/java/io/grpc/xds/XdsNameResolver.java
xds/src/main/java/io/grpc/xds/XdsNameResolver.java#L680-L684
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.
Add unit test for this case as well.
Check warning on line 392 in xds/src/main/java/io/grpc/xds/XdsServerWrapper.java
xds/src/main/java/io/grpc/xds/XdsServerWrapper.java#L391-L392
Check warning on line 461 in xds/src/main/java/io/grpc/xds/XdsServerWrapper.java
xds/src/main/java/io/grpc/xds/XdsServerWrapper.java#L461
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 we have a unit test for this if block?
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 tests test hostname mismatch and port mismatch but not missing host or missing port. Like "127.0.0.0" or ":8080"
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 get problems with the previous way?
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.
No, there were no problems here but I think if port isn't available or ports are not same then there's no point of parsing HostAndPort into InetAddress
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.
Follow http://go/unit-test-practices#structure