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

Replace C2P resolver env var with experimental scheme suffix #8744

Merged
merged 3 commits into from Dec 7, 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
Expand Up @@ -29,9 +29,7 @@
@Internal
public final class GoogleCloudToProdNameResolverProvider extends NameResolverProvider {

private static final boolean enableC2PResolver =
Boolean.parseBoolean(System.getenv("GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER"));
private static final String SCHEME = "google-c2p";
private static final String SCHEME = "google-c2p-experimental";

@Override
public NameResolver newNameResolver(URI targetUri, Args args) {
Expand All @@ -50,10 +48,7 @@ public String getDefaultScheme() {

@Override
protected boolean isAvailable() {
if (enableC2PResolver) {
return true;
}
return false;
return true;
}

@Override
Expand Down
Expand Up @@ -73,7 +73,8 @@ NameResolverProvider.class, getClass().getClassLoader())) {

@Test
public void newNameResolver() {
assertThat(provider.newNameResolver(URI.create("google-c2p:///foo.googleapis.com"), args))
assertThat(provider
.newNameResolver(URI.create("google-c2p-experimental:///foo.googleapis.com"), args))
.isInstanceOf(GoogleCloudToProdNameResolver.class);
}
}
Expand Up @@ -69,7 +69,7 @@ public class GoogleCloudToProdNameResolverTest {
@Rule
public final MockitoRule mocks = MockitoJUnit.rule();

private static final URI TARGET_URI = URI.create("google-c2p:///googleapis.com");
private static final URI TARGET_URI = URI.create("google-c2p-experimental:///googleapis.com");
private static final String ZONE = "us-central1-a";
private static final int DEFAULT_PORT = 887;

Expand Down