xds: enable v3 API in bootstrap generated by cloud-to-prod resolver (#7995)

This commit is contained in:
apolcyn 2021-03-19 15:26:15 -07:00 committed by GitHub
parent ab216a1720
commit ccd43b64e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -187,6 +187,7 @@ final class GoogleCloudToProdNameResolver extends NameResolver {
serverBuilder.put("server_uri", server_uri);
serverBuilder.put("channel_creds",
ImmutableList.of(ImmutableMap.of("type", "google_default")));
serverBuilder.put("server_features", ImmutableList.of("xds_v3"));
return ImmutableMap.of(
"node", nodeBuilder.build(),
"xds_servers", ImmutableList.of(serverBuilder.build()));

View File

@ -183,7 +183,8 @@ public class GoogleCloudToProdNameResolverTest {
(List<Map<String, ?>>) bootstrap.get("xds_servers"));
assertThat(server).containsExactly(
"server_uri", "directpath-trafficdirector.googleapis.com",
"channel_creds", ImmutableList.of(ImmutableMap.of("type", "google_default")));
"channel_creds", ImmutableList.of(ImmutableMap.of("type", "google_default")),
"server_features", ImmutableList.of("xds_v3"));
}
@Test