mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #40397 from yujuhong/protoc_settings
Automatic merge from submit-queue (batch tested with PRs 40239, 40397, 40449, 40448, 40360) CRI: use more gogoprotobuf plugins Generate marshaler/unmarshaler code should help improve the performance. This addresses #40098
This commit is contained in:
		@@ -29,7 +29,7 @@ BINS=(
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
 | 
					make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; then
 | 
					if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3."* ]]; then
 | 
				
			||||||
  echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
 | 
					  echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
 | 
				
			||||||
  echo "install the platform appropriate Protobuf package for your OS: "
 | 
					  echo "install the platform appropriate Protobuf package for your OS: "
 | 
				
			||||||
  echo
 | 
					  echo
 | 
				
			||||||
@@ -46,8 +46,17 @@ function cleanup {
 | 
				
			|||||||
trap cleanup EXIT
 | 
					trap cleanup EXIT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gogopath=$(dirname $(kube::util::find-binary "protoc-gen-gogo"))
 | 
					gogopath=$(dirname $(kube::util::find-binary "protoc-gen-gogo"))
 | 
				
			||||||
export PATH=$gogopath:$PATH
 | 
					
 | 
				
			||||||
protoc -I${KUBE_REMOTE_RUNTIME_ROOT} --gogo_out=plugins=grpc:${KUBE_REMOTE_RUNTIME_ROOT} ${KUBE_REMOTE_RUNTIME_ROOT}/api.proto
 | 
					PATH="${gogopath}:${PATH}" \
 | 
				
			||||||
 | 
					  protoc \
 | 
				
			||||||
 | 
					  --proto_path="${KUBE_REMOTE_RUNTIME_ROOT}" \
 | 
				
			||||||
 | 
					  --proto_path="${KUBE_ROOT}/vendor" \
 | 
				
			||||||
 | 
					  --gogo_out=plugins=grpc:${KUBE_REMOTE_RUNTIME_ROOT} ${KUBE_REMOTE_RUNTIME_ROOT}/api.proto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Update boilerplate for the generated file.
 | 
				
			||||||
echo "$(cat hack/boilerplate/boilerplate.go.txt ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go)" > ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
 | 
					echo "$(cat hack/boilerplate/boilerplate.go.txt ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go)" > ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
 | 
				
			||||||
sed -i".bak" "s/Copyright YEAR/Copyright $(date '+%Y')/g" ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
 | 
					sed -i".bak" "s/Copyright YEAR/Copyright $(date '+%Y')/g" ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Run gofmt to clean up the generated code.
 | 
				
			||||||
 | 
					kube::golang::verify_go_version
 | 
				
			||||||
 | 
					gofmt -l -s -w ${KUBE_REMOTE_RUNTIME_ROOT}/api.pb.go
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,9 @@ go_library(
 | 
				
			|||||||
    ],
 | 
					    ],
 | 
				
			||||||
    tags = ["automanaged"],
 | 
					    tags = ["automanaged"],
 | 
				
			||||||
    deps = [
 | 
					    deps = [
 | 
				
			||||||
 | 
					        "//vendor:github.com/gogo/protobuf/gogoproto",
 | 
				
			||||||
        "//vendor:github.com/gogo/protobuf/proto",
 | 
					        "//vendor:github.com/gogo/protobuf/proto",
 | 
				
			||||||
 | 
					        "//vendor:github.com/gogo/protobuf/sortkeys",
 | 
				
			||||||
        "//vendor:golang.org/x/net/context",
 | 
					        "//vendor:golang.org/x/net/context",
 | 
				
			||||||
        "//vendor:google.golang.org/grpc",
 | 
					        "//vendor:google.golang.org/grpc",
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -3,6 +3,16 @@ syntax = 'proto3';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package runtime;
 | 
					package runtime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "github.com/gogo/protobuf/gogoproto/gogo.proto";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					option (gogoproto.goproto_stringer_all) = false;
 | 
				
			||||||
 | 
					option (gogoproto.stringer_all) =  true;
 | 
				
			||||||
 | 
					option (gogoproto.goproto_getters_all) = true;
 | 
				
			||||||
 | 
					option (gogoproto.marshaler_all) = true;
 | 
				
			||||||
 | 
					option (gogoproto.sizer_all) = true;
 | 
				
			||||||
 | 
					option (gogoproto.unmarshaler_all) = true;
 | 
				
			||||||
 | 
					option (gogoproto.goproto_unrecognized_all) = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Runtime service defines the public APIs for remote container runtimes
 | 
					// Runtime service defines the public APIs for remote container runtimes
 | 
				
			||||||
service RuntimeService {
 | 
					service RuntimeService {
 | 
				
			||||||
    // Version returns the runtime name, runtime version, and runtime API version.
 | 
					    // Version returns the runtime name, runtime version, and runtime API version.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user