Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
1 change: 0 additions & 1 deletion internal/xds/balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
_ "google.golang.org/grpc/internal/xds/balancer/cdsbalancer" // Register the CDS balancer
_ "google.golang.org/grpc/internal/xds/balancer/clusterimpl" // Register the xds_cluster_impl balancer
_ "google.golang.org/grpc/internal/xds/balancer/clustermanager" // Register the xds_cluster_manager balancer
_ "google.golang.org/grpc/internal/xds/balancer/clusterresolver" // Register the xds_cluster_resolver balancer
_ "google.golang.org/grpc/internal/xds/balancer/outlierdetection" // Register the outlier_detection balancer
_ "google.golang.org/grpc/internal/xds/balancer/priority" // Register the priority balancer
)
361 changes: 148 additions & 213 deletions internal/xds/balancer/cdsbalancer/aggregate_cluster_test.go

Large diffs are not rendered by default.

615 changes: 277 additions & 338 deletions internal/xds/balancer/cdsbalancer/cdsbalancer.go

Large diffs are not rendered by default.

19 changes: 1 addition & 18 deletions internal/xds/balancer/cdsbalancer/cdsbalancer_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"encoding/json"
"fmt"
"os"
"strings"
"testing"

"github.com/google/uuid"
Expand Down Expand Up @@ -552,14 +551,8 @@ func (s) TestSecurityConfigUpdate_GoodToFallback(t *testing.T) {
// bootstrap file contents. Verifies that the connection between the client and
// the server is secure. Subsequently, the cds LB policy receives a cluster
// resource that is NACKed by the xDS client. Test verifies that the cds LB
// policy continues to use the previous good configuration, but the error from
// the xDS client is propagated to the child policy.
// policy continues to use the previous good configuration.
func (s) TestSecurityConfigUpdate_GoodToBad(t *testing.T) {
// Register a wrapped clusterresolver LB policy (child policy of the cds LB
// policy) for the duration of this test that makes the resolver error
// pushed to it available to the test.
_, resolverErrCh, _, _ := registerWrappedClusterResolverPolicy(t)

// Spin up an xDS management server.
mgmtServer := e2e.StartManagementServer(t, e2e.ManagementServerOptions{})

Expand Down Expand Up @@ -615,16 +608,6 @@ func (s) TestSecurityConfigUpdate_GoodToBad(t *testing.T) {
t.Fatal(err)
}

const wantNACKErr = "instance name \"unknown-certificate-provider-instance\" missing in bootstrap configuration"
select {
case err := <-resolverErrCh:
if !strings.Contains(err.Error(), wantNACKErr) {
t.Fatalf("Child policy got resolver error: %v, want err: %v", err, wantNACKErr)
}
case <-ctx.Done():
t.Fatal("Timeout when waiting for resolver error to be pushed to the child policy")
}

// Verify that a successful RPC can be made over a secure connection.
if _, err := client.EmptyCall(ctx, &testpb.Empty{}, grpc.WaitForReady(true)); err != nil {
t.Fatalf("EmptyCall() failed: %v", err)
Expand Down
Loading