Skip to content

Commit

Permalink
xds: readd NewXDSResolverWithConfigForTesting() (#5504)
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Jul 14, 2022
1 parent 4f47c8c commit 96aa657
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions xds/xds.go
Expand Up @@ -33,7 +33,9 @@ import (
v3statusgrpc "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
"google.golang.org/grpc"
_ "google.golang.org/grpc/credentials/tls/certprovider/pemfile" // Register the file watcher certificate provider plugin.
"google.golang.org/grpc/internal"
internaladmin "google.golang.org/grpc/internal/admin"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/xds/csds"
_ "google.golang.org/grpc/xds/internal/balancer" // Register the balancers.
_ "google.golang.org/grpc/xds/internal/clusterspecifier/rls" // Register the RLS cluster specifier plugin. Note that this does not register the RLS LB policy.
Expand Down Expand Up @@ -73,3 +75,21 @@ func init() {
return csdss.Close, nil
})
}

// NewXDSResolverWithConfigForTesting creates a new xDS resolver builder using
// the provided xDS bootstrap config instead of the global configuration from
// the supported environment variables. The resolver.Builder is meant to be
// used in conjunction with the grpc.WithResolvers DialOption.
//
// Testing Only
//
// This function should ONLY be used for testing and may not work with some
// other features, including the CSDS service.
//
// Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func NewXDSResolverWithConfigForTesting(bootstrapConfig []byte) (resolver.Builder, error) {
return internal.NewXDSResolverWithConfigForTesting.(func([]byte) (resolver.Builder, error))(bootstrapConfig)
}

0 comments on commit 96aa657

Please sign in to comment.