Skip to content

Commit 2e5b5de

Browse files
authored
Upgrade protoc and protoc-gen-go-grpc versions to matching terraform-plugin-go (#37647)
* Update protoc version in downloader script * go get google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 This matched terraform-plugin-go * make protobuf * Run `make protobuf` * Update generator to handle generic types from google.golang.org/grpc Looks like this was added in v1.69.3 in grpc/grpc-go#7057 ? * Run `make generate` * Fix "cannot infer Res" compile error - more usage of generics * More fixing compile errors due to switching to use of a generic * Make putting `google.golang.org/grpc` import into generated files conditional * Run `make generate` * Update more places where generics now need to be used * Update generator to handle any types from google.golang.org/grpc in same switch case.
1 parent edf0cd6 commit 2e5b5de

File tree

33 files changed

+896
-1024
lines changed

33 files changed

+896
-1024
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ require (
8282
golang.org/x/tools v0.36.0
8383
golang.org/x/tools/cmd/cover v0.1.0-deprecated
8484
google.golang.org/grpc v1.69.4
85-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
85+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
8686
google.golang.org/protobuf v1.36.6
8787
honnef.co/go/tools v0.6.0
8888
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
12781278
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
12791279
google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
12801280
google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
1281-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA=
1282-
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y=
1281+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A=
1282+
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA=
12831283
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
12841284
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
12851285
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

internal/cloudplugin/cloudplugin1/grpc_client_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
var mockError = "this is a mock error"
2020

21-
func testGRPCloudClient(t *testing.T, ctrl *gomock.Controller, client *mock_cloudproto1.MockCommandService_ExecuteClient, executeError error) *GRPCCloudClient {
21+
func testGRPCloudClient(t *testing.T, ctrl *gomock.Controller, client *mock_cloudproto1.MockCommandService_ExecuteClient[cloudproto1.CommandResponse], executeError error) *GRPCCloudClient {
2222
t.Helper()
2323

2424
if client != nil && executeError != nil {
@@ -57,7 +57,7 @@ func Test_GRPCCloudClient_ExecuteError(t *testing.T) {
5757

5858
func Test_GRPCCloudClient_Execute_RecvError(t *testing.T) {
5959
ctrl := gomock.NewController(t)
60-
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient(ctrl)
60+
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient[cloudproto1.CommandResponse](ctrl)
6161
executeClient.EXPECT().Recv().Return(nil, errors.New(mockError))
6262

6363
gRPCClient := testGRPCloudClient(t, ctrl, executeClient, nil)
@@ -78,7 +78,7 @@ func Test_GRPCCloudClient_Execute_RecvError(t *testing.T) {
7878

7979
func Test_GRPCCloudClient_Execute_Invalid_Exit(t *testing.T) {
8080
ctrl := gomock.NewController(t)
81-
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient(ctrl)
81+
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient[cloudproto1.CommandResponse](ctrl)
8282

8383
executeClient.EXPECT().Recv().Return(
8484
&cloudproto1.CommandResponse{
@@ -99,7 +99,7 @@ func Test_GRPCCloudClient_Execute_Invalid_Exit(t *testing.T) {
9999

100100
func Test_GRPCCloudClient_Execute(t *testing.T) {
101101
ctrl := gomock.NewController(t)
102-
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient(ctrl)
102+
executeClient := mock_cloudproto1.NewMockCommandService_ExecuteClient[cloudproto1.CommandResponse](ctrl)
103103

104104
gomock.InOrder(
105105
executeClient.EXPECT().Recv().Return(

internal/cloudplugin/cloudproto1/cloudproto1.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cloudplugin/cloudproto1/cloudproto1_grpc.pb.go

Lines changed: 37 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/cloudplugin/mock_cloudproto1/mock.go

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/plans/planproto/planfile.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)