chore: migrate to grpc-gateway/v2 and eliminate gogo/protobuf #26386
+41,471
−70,041
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Migrate to grpc-gateway/v2 and eliminate gogo/protobuf
k8s.io/code-generator v0.35.1 provides two critical flags:
--drop-gogo-go: Generates protobuf methods usinggoogle.golang.org/protobufinstead of gogo (for .pb.go files)--keep-gogoproto=false: Removes gogo imports and annotations from proto files (for .proto files)This allows manually-defined CRD types to coexist with protobuf serialization without duplicate type declarations.
Changes
Dependencies:
Proto Generation:
go-to-protobuf --drop-gogo-go --keep-gogoproto=falseprotoc-gen-go+protoc-gen-go-grpc(v2 tooling)Code:
github.com/grpc-ecosystem/grpc-gateway→github.com/grpc-ecosystem/grpc-gateway/v2/runtime(server.go, forwarder_overwrite.go, json.go)+optional,+genclient, etc.) from swagger.json descriptionsChecklist: