@@ -25,6 +25,8 @@ import (
2525
2626 v3corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
2727 "github.com/google/go-cmp/cmp"
28+ "google.golang.org/grpc/internal/envconfig"
29+ "google.golang.org/grpc/internal/testutils"
2830 "google.golang.org/grpc/internal/xds/bootstrap"
2931 "google.golang.org/grpc/metadata"
3032 "google.golang.org/protobuf/types/known/anypb"
@@ -40,7 +42,7 @@ func bootstrapConfig(t *testing.T, allowed string) *bootstrap.Config {
4042 contents , err := bootstrap .NewContentsForTesting (bootstrap.ConfigOptionsForTesting {
4143 Servers : json .RawMessage (`[{"server_uri":"td.googleapis.com:443","channel_creds":[{"type":"insecure"}]}]` ),
4244 Node : json .RawMessage (`{}` ),
43- AllowedGrpcServices : json .RawMessage (allowed ),
45+ AllowedGRPCServices : json .RawMessage (allowed ),
4446 })
4547 if err != nil {
4648 t .Fatalf ("NewContentsForTesting() failed: %v" , err )
@@ -65,6 +67,10 @@ func googleGrpcService(target string, channelPlugins []*anypb.Any, timeout *dura
6567}
6668
6769func TestParse (t * testing.T ) {
70+ // The allowed_grpc_services bootstrap field is parsed only when a
71+ // consuming feature is enabled.
72+ testutils .SetEnvConfig (t , & envconfig .XDSClientExtProcEnabled , true )
73+
6874 insecurePlugin := & anypb.Any {TypeUrl : insecureCredsTypeURL }
6975 allowedInsecure := `{"dns:///my-service:443":{"channel_creds":[{"type":"insecure"}]}}`
7076
0 commit comments