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

xds: Allow unspecified listener traffic direction to work with Istio #9173

Merged
merged 3 commits into from May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion xds/src/main/java/io/grpc/xds/ClientXdsClient.java
Expand Up @@ -385,7 +385,8 @@ static EnvoyServerProtoData.Listener parseServerSideListener(
Listener proto, Set<String> rdsResources, TlsContextManager tlsContextManager,
FilterRegistry filterRegistry, Set<String> certProviderInstances, boolean parseHttpFilter)
throws ResourceInvalidException {
if (!proto.getTrafficDirection().equals(TrafficDirection.INBOUND)) {
if (!proto.getTrafficDirection().equals(TrafficDirection.INBOUND)
&& !proto.getTrafficDirection().equals(TrafficDirection.UNSPECIFIED)) {
throw new ResourceInvalidException(
"Listener " + proto.getName() + " with invalid traffic direction: "
+ proto.getTrafficDirection());
Expand Down
10 changes: 10 additions & 0 deletions xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java
Expand Up @@ -2006,6 +2006,16 @@ public void parseServerSideListener_invalidTrafficDirection() throws ResourceInv
listener, new HashSet<String>(), null, filterRegistry, null, true /* does not matter */);
}

@Test
public void parseServerSideListener_noTrafficDirection() throws ResourceInvalidException {
Listener listener =
Listener.newBuilder()
.setName("listener1")
.build();
ClientXdsClient.parseServerSideListener(
listener, new HashSet<String>(), null, filterRegistry, null, true /* does not matter */);
}

@Test
public void parseServerSideListener_listenerFiltersPresent() throws ResourceInvalidException {
Listener listener =
Expand Down