Skip to content

Commit

Permalink
nil check for r.cc in r.onError, before calling r.cc.ReportError(err)
Browse files Browse the repository at this point in the history
  • Loading branch information
purnesh42H committed Dec 21, 2024
1 parent d11cf5f commit 325def2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xds/internal/balancer/clusterresolver/e2e_test/eds_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,11 @@ func (s) TestEDS_EndpointWithMultipleAddresses(t *testing.T) {
// Create bootstrap configuration pointing to the above management server.
nodeID := uuid.New().String()
bootstrapContents := e2e.DefaultBootstrapContents(t, nodeID, mgmtServer.Address)
config, err := bootstrap.NewConfigForTesting(bootstrapContents)
if err != nil {
t.Fatalf("Failed to create an bootstrap config from contents: %v, %v", bootstrapContents, err)
}
pool := xdsclient.NewPool(config)

// Create xDS resources for consumption by the test. We start off with a
// single backend in a single EDS locality.
Expand All @@ -1288,9 +1293,8 @@ func (s) TestEDS_EndpointWithMultipleAddresses(t *testing.T) {

// Create an xDS client talking to the above management server, configured
// with a short watch expiry timeout.
xdsClient, close, err := xdsclient.NewForTesting(xdsclient.OptionsForTesting{
Name: t.Name(),
Contents: bootstrapContents,
xdsClient, close, err := pool.NewClientForTesting(xdsclient.OptionsForTesting{
Name: t.Name(),
})
if err != nil {
t.Fatalf("Failed to create an xDS client: %v", err)
Expand Down
1 change: 1 addition & 0 deletions xds/internal/resolver/xds_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func init() {

rinternal.NewWRR = wrr.NewRandom
rinternal.NewXDSClient = func(name string) (xdsclient.XDSClient, func(), error) { return xdsClientPool.NewClient(name) }

}

type xdsResolverBuilder struct {
Expand Down

0 comments on commit 325def2

Please sign in to comment.