Skip to content

Commit

Permalink
Backport "xds/c2p: replace C2P resolver env var with experimental sch…
Browse files Browse the repository at this point in the history
…eme suffix grpc#5044" to 1.43.x (grpc#5047)
  • Loading branch information
apolcyn authored Dec 8, 2021
1 parent 3786ae1 commit 46e883a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions internal/envconfig/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const (
rbacSupportEnv = "GRPC_XDS_EXPERIMENTAL_RBAC"
federationEnv = "GRPC_EXPERIMENTAL_XDS_FEDERATION"

c2pResolverSupportEnv = "GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER"
c2pResolverTestOnlyTrafficDirectorURIEnv = "GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI"
)

Expand Down Expand Up @@ -86,10 +85,6 @@ var (
// XDSFederation indicates whether federation support is enabled.
XDSFederation = strings.EqualFold(os.Getenv(federationEnv), "true")

// C2PResolver indicates whether support for C2P resolver is enabled.
// This can be enabled by setting the environment variable
// "GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER" to "true".
C2PResolver = strings.EqualFold(os.Getenv(c2pResolverSupportEnv), "true")
// C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing.
C2PResolverTestOnlyTrafficDirectorURI = os.Getenv(c2pResolverTestOnlyTrafficDirectorURIEnv)
)
6 changes: 2 additions & 4 deletions xds/googledirectpath/googlec2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (
)

const (
c2pScheme = "google-c2p"
c2pScheme = "google-c2p-experimental"

tdURL = "dns:///directpath-pa.googleapis.com"
httpReqTimeout = 10 * time.Second
Expand Down Expand Up @@ -75,9 +75,7 @@ var (
)

func init() {
if envconfig.C2PResolver {
resolver.Register(c2pResolverBuilder{})
}
resolver.Register(c2pResolverBuilder{})
}

type c2pResolverBuilder struct{}
Expand Down

0 comments on commit 46e883a

Please sign in to comment.