Skip to content

Commit

Permalink
run protoc-gen-go from vendor (#3842)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <[email protected]>
zroubalik authored Nov 10, 2022
1 parent b9a478c commit 93f7869
Showing 23 changed files with 5,231 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ jobs:
codeScanning:
name: Code Scanning
runs-on: ubuntu-latest

container: ghcr.io/kedacore/build-tools:1.18.8
strategy:
fail-fast: false
matrix:
@@ -191,6 +191,9 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

- name: Register workspace path
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.18.8 AS builder
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/build-tools:1.18.8 AS builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
2 changes: 1 addition & 1 deletion Dockerfile.adapter
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the adapter binary
FROM --platform=$BUILDPLATFORM golang:1.18.8 as builder
FROM --platform=$BUILDPLATFORM ghcr.io/kedacore/build-tools:1.18.8 as builder

ARG BUILD_VERSION=main
ARG GIT_COMMIT=HEAD
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ manifests: controller-gen ## Generate ClusterRole and CustomResourceDefinition o
# until this issue is fixed: https://github.com/kubernetes-sigs/controller-tools/issues/398
rm config/crd/bases/keda.sh_withtriggers.yaml

generate: controller-gen mockgen-gen ## Generate code containing DeepCopy, DeepCopyInto, DeepCopyObject method implementations (API) and mocks.
generate: controller-gen mockgen-gen proto-gen ## Generate code containing DeepCopy, DeepCopyInto, DeepCopyObject method implementations (API), mocks and proto.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

adapter/generated/openapi/zz_generated.openapi.go: go.mod go.sum ## Generate OpenAPI for KEDA Metrics Adapter.
@@ -148,17 +148,9 @@ clientset-verify: ## Verify that generated client-go clientset, listers and info
clientset-generate: ## Generate client-go clientset, listers and informers.
./hack/update-codegen.sh

# Generate Liiklus proto
pkg/scalers/liiklus/LiiklusService.pb.go: protoc-gen-go
protoc --proto_path=hack LiiklusService.proto --go_out=pkg/scalers/liiklus --go-grpc_out=pkg/scalers/liiklus

# Generate ExternalScaler proto
pkg/scalers/externalscaler/externalscaler.pb.go: protoc-gen-go
protoc --proto_path=pkg/scalers/externalscaler externalscaler.proto --go-grpc_out=pkg/scalers/externalscaler

protoc-gen-go: ## Download protoc-gen-go
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
proto-gen: protoc-gen ## Generate Liiklus, ExternalScaler and MetricsService proto
PATH=$(LOCALBIN):$(PATH) protoc -I vendor --proto_path=hack LiiklusService.proto --go_out=pkg/scalers/liiklus --go-grpc_out=pkg/scalers/liiklus
PATH=$(LOCALBIN):$(PATH) protoc -I vendor --proto_path=pkg/scalers/externalscaler externalscaler.proto --go_out=pkg/scalers/externalscaler --go-grpc_out=pkg/scalers/externalscaler

.PHONY: mockgen-gen
mockgen-gen: mockgen pkg/mock/mock_scaling/mock_interface.go pkg/mock/mock_scaler/mock_scaler.go pkg/mock/mock_scale/mock_interfaces.go pkg/mock/mock_client/mock_interfaces.go pkg/scalers/liiklus/mocks/mock_liiklus.go
@@ -272,6 +264,8 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
MOCKGEN ?= $(LOCALBIN)/mockgen
PROTOCGEN ?= $(LOCALBIN)/protoc-gen-go
PROTOCGEN_GRPC ?= $(LOCALBIN)/protoc-gen-go-grpc

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Install controller-gen from vendor dir if necessary.
@@ -293,6 +287,13 @@ mockgen: $(MOCKGEN) ## Install mockgen from vendor dir if necessary.
$(MOCKGEN): $(LOCALBIN)
test -s $(LOCALBIN)/mockgen || GOBIN=$(LOCALBIN) go install github.com/golang/mock/mockgen

.PHONY: protoc-gen
protoc-gen: $(PROTOCGEN) $(PROTOCGEN_GRPC) ## Install protoc-gen from vendor dir if necessary.
$(PROTOCGEN): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install google.golang.org/protobuf/cmd/protoc-gen-go
$(PROTOCGEN_GRPC): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install google.golang.org/grpc/cmd/protoc-gen-go-grpc


##################################################
# General #
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -64,6 +64,7 @@ require (
golang.org/x/oauth2 v0.1.0
google.golang.org/api v0.101.0
google.golang.org/grpc v1.50.1
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0
google.golang.org/protobuf v1.28.1
k8s.io/api v0.24.5
k8s.io/apimachinery v0.24.5
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1455,6 +1455,8 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
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=
2 changes: 2 additions & 0 deletions hack/tools.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ package tools
import (
// Import code-generator to use in build tools
_ "github.com/golang/mock/mockgen"
_ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
_ "google.golang.org/protobuf/cmd/protoc-gen-go"
_ "k8s.io/code-generator"
_ "k8s.io/kube-openapi/cmd/openapi-gen"
_ "sigs.k8s.io/controller-runtime/tools/setup-envtest"
2 changes: 1 addition & 1 deletion pkg/scalers/externalscaler/externalscaler.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/scalers/externalscaler/externalscaler_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pkg/scalers/liiklus/LiiklusService.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/scalers/liiklus/LiiklusService_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

202 changes: 202 additions & 0 deletions vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

449 changes: 449 additions & 0 deletions vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions vendor/google.golang.org/protobuf/cmd/protoc-gen-go/main.go
1,261 changes: 1,261 additions & 0 deletions vendor/google.golang.org/protobuf/compiler/protogen/protogen.go

Large diffs are not rendered by default.

653 changes: 653 additions & 0 deletions vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1445,8 +1445,14 @@ 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.2.0
## explicit; go 1.9
google.golang.org/grpc/cmd/protoc-gen-go-grpc
# google.golang.org/protobuf v1.28.1
## explicit; go 1.11
google.golang.org/protobuf/cmd/protoc-gen-go
google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo
google.golang.org/protobuf/compiler/protogen
google.golang.org/protobuf/encoding/protojson
google.golang.org/protobuf/encoding/prototext
google.golang.org/protobuf/encoding/protowire
@@ -1483,6 +1489,7 @@ google.golang.org/protobuf/types/known/fieldmaskpb
google.golang.org/protobuf/types/known/structpb
google.golang.org/protobuf/types/known/timestamppb
google.golang.org/protobuf/types/known/wrapperspb
google.golang.org/protobuf/types/pluginpb
# gopkg.in/inf.v0 v0.9.1
## explicit
gopkg.in/inf.v0

0 comments on commit 93f7869

Please sign in to comment.