Repository: googleapis/gapic-generator-go
Pull request #812 (2021-11-11 23:26:35)

gapic: remove disable serv config dial opt
Since https://github.com/googleapis/google-api-go-client/pull/1260 we need to start allowing the service config to be pulled.

cc @mohanli-ml


Patch:
diff --git a/internal/gengapic/gengrpc.go b/internal/gengapic/gengrpc.go
index 79ae821..e5abe71 100644
--- a/internal/gengapic/gengrpc.go
+++ b/internal/gengapic/gengrpc.go
@@ -199,7 +199,6 @@ func (g *generator) grpcClientOptions(serv *descriptor.ServiceDescriptorProto, s
 	p("    internaloption.WithDefaultAudience(%q),", generateDefaultAudience(host))
 	p("    internaloption.WithDefaultScopes(DefaultAuthScopes()...),")
 	p("    internaloption.EnableJwtWithScope(),")
-	p("    option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),")
 	p("    option.WithGRPCDialOption(grpc.WithDefaultCallOptions(")
 	p("      grpc.MaxCallRecvMsgSize(math.MaxInt32))),")
 	p("  }")


Test patch:
diff --git a/internal/gengapic/testdata/empty_opt.want b/internal/gengapic/testdata/empty_opt.want
index 45ae194..f245fd8 100644
--- a/internal/gengapic/testdata/empty_opt.want
+++ b/internal/gengapic/testdata/empty_opt.want
@@ -22,7 +22,6 @@ func defaultGRPCClientOptions() []option.ClientOption {
 		internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
 		internaloption.WithDefaultScopes(DefaultAuthScopes()...),
 		internaloption.EnableJwtWithScope(),
-		option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
 		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
 		grpc.MaxCallRecvMsgSize(math.MaxInt32))),
 	}
diff --git a/internal/gengapic/testdata/foo_opt.want b/internal/gengapic/testdata/foo_opt.want
index bff1f4f..29cec55 100644
--- a/internal/gengapic/testdata/foo_opt.want
+++ b/internal/gengapic/testdata/foo_opt.want
@@ -22,7 +22,6 @@ func defaultFooGRPCClientOptions() []option.ClientOption {
 		internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
 		internaloption.WithDefaultScopes(DefaultAuthScopes()...),
 		internaloption.EnableJwtWithScope(),
-		option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
 		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
 		grpc.MaxCallRecvMsgSize(math.MaxInt32))),
 	}
diff --git a/internal/gengapic/testdata/host_port_opt.want b/internal/gengapic/testdata/host_port_opt.want
index 6776db3..6df43a8 100644
--- a/internal/gengapic/testdata/host_port_opt.want
+++ b/internal/gengapic/testdata/host_port_opt.want
@@ -20,7 +20,6 @@ func defaultBarGRPCClientOptions() []option.ClientOption {
 		internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
 		internaloption.WithDefaultScopes(DefaultAuthScopes()...),
 		internaloption.EnableJwtWithScope(),
-		option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
 		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
 		grpc.MaxCallRecvMsgSize(math.MaxInt32))),
 	}
diff --git a/internal/gengapic/testdata/iam_override_opt.want b/internal/gengapic/testdata/iam_override_opt.want
index 16554cb..9d88040 100644
--- a/internal/gengapic/testdata/iam_override_opt.want
+++ b/internal/gengapic/testdata/iam_override_opt.want
@@ -19,7 +19,6 @@ func defaultBazGRPCClientOptions() []option.ClientOption {
 		internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
 		internaloption.WithDefaultScopes(DefaultAuthScopes()...),
 		internaloption.EnableJwtWithScope(),
-		option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
 		option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
 		grpc.MaxCallRecvMsgSize(math.MaxInt32))),
 	}