From 47ecc835c310a225352dd06c8034bf170f80ba50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 15:19:26 +0000 Subject: [PATCH 1/2] vendor: bump google.golang.org/grpc/cmd/protoc-gen-go-grpc Bumps [google.golang.org/grpc/cmd/protoc-gen-go-grpc](https://github.com/grpc/grpc-go) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/cmd/protoc-gen-go-grpc/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: google.golang.org/grpc/cmd/protoc-gen-go-grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- .../grpc/cmd/protoc-gen-go-grpc/grpc.go | 23 +++++++++++++++++-- .../grpc/cmd/protoc-gen-go-grpc/main.go | 2 +- vendor/modules.txt | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index d827091d8..8cd594ace 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.8.0 go.uber.org/zap v1.23.0 google.golang.org/grpc v1.49.0 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf v1.28.1 k8s.io/api v0.25.0 k8s.io/apimachinery v0.25.0 diff --git a/go.sum b/go.sum index 7ad6bb740..e24dc98df 100644 --- a/go.sum +++ b/go.sum @@ -1646,8 +1646,9 @@ google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ5 google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 h1:TLkBREm4nIsEcexnCjgQd5GQWaHcqMzwQV0TX9pq8S0= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go b/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go index 1e787344e..f45e0403f 100644 --- a/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go +++ b/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go @@ -24,7 +24,6 @@ import ( "strings" "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/types/descriptorpb" ) @@ -43,6 +42,14 @@ func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated filename := file.GeneratedFilenamePrefix + "_grpc.pb.go" g := gen.NewGeneratedFile(filename, file.GoImportPath) g.P("// Code generated by protoc-gen-go-grpc. DO NOT EDIT.") + g.P("// versions:") + g.P("// - protoc-gen-go-grpc v", version) + g.P("// - protoc ", protocVersion(gen)) + if file.Proto.GetOptions().GetDeprecated() { + g.P("// ", file.Desc.Path(), " is a deprecated file.") + } else { + g.P("// source: ", file.Desc.Path()) + } g.P() g.P("package ", file.GoPackageName) g.P() @@ -50,6 +57,18 @@ func generateFile(gen *protogen.Plugin, file *protogen.File) *protogen.Generated return g } +func protocVersion(gen *protogen.Plugin) string { + v := gen.Request.GetCompilerVersion() + if v == nil { + return "(unknown)" + } + var suffix string + if s := v.GetSuffix(); s != "" { + suffix = "-" + s + } + return fmt.Sprintf("v%d.%d.%d%s", v.GetMajor(), v.GetMinor(), v.GetPatch(), suffix) +} + // generateFileContent generates the gRPC service definitions, excluding the package statement. func generateFileContent(gen *protogen.Plugin, file *protogen.File, g *protogen.GeneratedFile) { if len(file.Services) == 0 { @@ -188,7 +207,7 @@ func genService(gen *protogen.Plugin, file *protogen.File, g *protogen.Generated g.P() // Server handler implementations. - var handlerNames []string + handlerNames := make([]string, 0, len(service.Methods)) for _, method := range service.Methods { hname := genServerMethod(gen, file, g, method) handlerNames = append(handlerNames, hname) diff --git a/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go b/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go index 7f104da7d..58cde2eb6 100644 --- a/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go +++ b/vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go @@ -38,7 +38,7 @@ import ( "google.golang.org/protobuf/types/pluginpb" ) -const version = "1.1.0" +const version = "1.2.0" var requireUnimplemented *bool diff --git a/vendor/modules.txt b/vendor/modules.txt index 4d854dcb4..62e8bd265 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1192,7 +1192,7 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 +# google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 ## explicit; go 1.9 google.golang.org/grpc/cmd/protoc-gen-go-grpc # google.golang.org/protobuf v1.28.1 From cf5764b2c4b5f36729ebeffddc8a2911fdd58305 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 13 Sep 2022 12:06:47 +0200 Subject: [PATCH 2/2] build: update generated .pb.go files with new protoc-gen-go-grpc Signed-off-by: Niels de Vos --- internal/proto/networkfence_grpc.pb.go | 4 ++++ internal/proto/reclaimspace_grpc.pb.go | 4 ++++ internal/proto/replication_grpc.pb.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/internal/proto/networkfence_grpc.pb.go b/internal/proto/networkfence_grpc.pb.go index b2e12abaf..8eca23afe 100644 --- a/internal/proto/networkfence_grpc.pb.go +++ b/internal/proto/networkfence_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: networkfence.proto package proto diff --git a/internal/proto/reclaimspace_grpc.pb.go b/internal/proto/reclaimspace_grpc.pb.go index d3e4be808..f2165661e 100644 --- a/internal/proto/reclaimspace_grpc.pb.go +++ b/internal/proto/reclaimspace_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: reclaimspace.proto package proto diff --git a/internal/proto/replication_grpc.pb.go b/internal/proto/replication_grpc.pb.go index 863246c56..554b472bd 100644 --- a/internal/proto/replication_grpc.pb.go +++ b/internal/proto/replication_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: replication.proto package proto