Skip to content

Commit

Permalink
Review comments #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Aug 11, 2020
1 parent da7e12d commit 2359531
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ func (s) TestClientWrapperWatchEDS(t *testing.T) {
if err != nil {
t.Fatalf("Failed to start fake xDS server: %v", err)
}
defer cleanup()

cw := newXDSClientWrapper(nil, balancer.BuildOptions{Target: resolver.Target{Endpoint: testServiceName}}, nil, nil)
defer cw.close()
defer cleanup()

for _, test := range []struct {
name string
Expand Down
4 changes: 3 additions & 1 deletion xds/internal/client/v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type client struct {
}

// AddWatch overrides the transport helper's AddWatch to save the LDS
// resource_name. This is required when handling an RDS response to perform hot
// resource_name. This is required when handling an RDS response to perform host
// matching.
func (v2c *client) AddWatch(resourceType, resourceName string) {
v2c.mu.Lock()
Expand All @@ -112,6 +112,8 @@ func (v2c *client) AddWatch(resourceType, resourceName string) {
v2c.TransportHelper.AddWatch(resourceType, resourceName)
}

// RemoveWatch overrides the transport helper's RemoveWatch to clear the LDS
// resource_name when the last watch is removed.
func (v2c *client) RemoveWatch(resourceType, resourceName string) {
v2c.mu.Lock()
// Special handling for LDS, because RDS needs the LDS resource_name for
Expand Down

0 comments on commit 2359531

Please sign in to comment.