Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions xds/googledirectpath/googlec2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ import (
)

const (
c2pScheme = "google-c2p"
c2pExperimentalScheme = "google-c2p-experimental"
c2pAuthority = "traffic-director-c2p.xds.googleapis.com"
c2pScheme = "google-c2p"
c2pAuthority = "traffic-director-c2p.xds.googleapis.com"

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

func init() {
resolver.Register(c2pResolverBuilder{
scheme: c2pScheme,
})
// TODO(apolcyn): remove this experimental scheme before the 1.52 release
resolver.Register(c2pResolverBuilder{
scheme: c2pExperimentalScheme,
})
resolver.Register(c2pResolverBuilder{})
}

type c2pResolverBuilder struct {
scheme string
}
type c2pResolverBuilder struct{}

func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) {
if t.URL.Host != "" {
Expand Down Expand Up @@ -165,7 +156,7 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
}

func (b c2pResolverBuilder) Scheme() string {
return b.scheme
return c2pScheme
}

type c2pResolver struct {
Expand Down