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: remove filter chain uuid name generator #8663

Merged
merged 1 commit into from Nov 4, 2021
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
7 changes: 1 addition & 6 deletions xds/src/main/java/io/grpc/xds/ClientXdsClient.java
Expand Up @@ -112,7 +112,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -441,14 +440,10 @@ static FilterChain parseFilterChain(
validateDownstreamTlsContext(downstreamTlsContextProto, certProviderInstances));
}

String name = proto.getName();
if (name.isEmpty()) {
name = UUID.randomUUID().toString();
}
FilterChainMatch filterChainMatch = parseFilterChainMatch(proto.getFilterChainMatch());
checkForUniqueness(uniqueSet, filterChainMatch);
return new FilterChain(
name,
proto.getName(),
filterChainMatch,
httpConnectionManager,
downstreamTlsContext,
Expand Down
2 changes: 1 addition & 1 deletion xds/src/main/java/io/grpc/xds/EnvoyServerProtoData.java
Expand Up @@ -314,7 +314,7 @@ public String toString() {
* Corresponds to Envoy proto message {@link io.envoyproxy.envoy.api.v2.listener.FilterChain}.
*/
static final class FilterChain {
// Unique name for the FilterChain.
// possibly empty
private final String name;
// TODO(sanjaypujare): flatten structure by moving FilterChainMatch class members here.
private final FilterChainMatch filterChainMatch;
Expand Down
4 changes: 2 additions & 2 deletions xds/src/test/java/io/grpc/xds/ClientXdsClientDataTest.java
Expand Up @@ -1587,7 +1587,7 @@ public void parseFilterChain_unsupportedFilter() throws ResourceInvalidException
}

@Test
public void parseFilterChain_noName_generatedUuid() throws ResourceInvalidException {
public void parseFilterChain_noName() throws ResourceInvalidException {
FilterChain filterChain1 =
FilterChain.newBuilder()
.setFilterChainMatch(FilterChainMatch.getDefaultInstance())
Expand Down Expand Up @@ -1615,7 +1615,7 @@ public void parseFilterChain_noName_generatedUuid() throws ResourceInvalidExcept
EnvoyServerProtoData.FilterChain parsedFilterChain2 = ClientXdsClient.parseFilterChain(
filterChain2, new HashSet<String>(), null, filterRegistry, null,
null, true /* does not matter */);
assertThat(parsedFilterChain1.getName()).isNotEqualTo(parsedFilterChain2.getName());
assertThat(parsedFilterChain1.getName()).isEqualTo(parsedFilterChain2.getName());
}

@Test
Expand Down