Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#1781 from justinsb/mockgcp_big…
Browse files Browse the repository at this point in the history
…table

mockgcp: Support for bigtable
  • Loading branch information
google-oss-prow[bot] authored Jul 10, 2024
2 parents 4244412 + 945947a commit 2829c65
Show file tree
Hide file tree
Showing 45 changed files with 8,594 additions and 161 deletions.
2 changes: 2 additions & 0 deletions config/tests/samples/create/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured

case schema.GroupKind{Group: "cloudbuild.cnrm.cloud.google.com", Kind: "CloudBuildWorkerPool"}:

case schema.GroupKind{Group: "bigtable.cnrm.cloud.google.com", Kind: "BigtableInstance"}:

case schema.GroupKind{Group: "cloudfunctions.cnrm.cloud.google.com", Kind: "CloudFunctionsFunction"}:
case schema.GroupKind{Group: "cloudids.cnrm.cloud.google.com", Kind: "CloudIDSEndpoint"}:

Expand Down
39 changes: 37 additions & 2 deletions mockgcp/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: gen-proto
gen-proto: generate-protos-from-openapi
.PHONY: all
all: generate-protos-from-openapi generate-grpc-for-google-protos gen-proto
mkdir -p bin/
GOBIN=`pwd`/bin/ go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.11.3 \
Expand All @@ -14,6 +14,25 @@ gen-proto: generate-protos-from-openapi

./fixup-third-party.sh

.PHONY: tools
tools:
mkdir -p bin/
GOBIN=`pwd`/bin/ go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.11.3 \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.11.3
GOBIN=`pwd`/bin/ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
GOBIN=`pwd`/bin/ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
wget -N -O bin/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.12.4/protoc-3.12.4-linux-x86_64.zip
cd bin; rm -rf protoc; mkdir protoc; cd protoc; unzip ../protoc.zip

.PHONY: gen-proto
gen-proto: tools
mkdir -p third_party
git clone https://github.com/googleapis/googleapis.git third_party/googleapis || (cd third_party/googleapis && git reset --hard origin/master && git pull)
mkdir -p ./generated

./fixup-third-party.sh

PATH=bin/:${PATH} bin/protoc/bin/protoc \
-I ./third_party/googleapis \
-I ./apis \
Expand Down Expand Up @@ -78,6 +97,22 @@ gen-proto: generate-protos-from-openapi
./third_party/googleapis/mockgrafeas/v1/*.proto


.PHONY: generate-grpc-for-google-protos
generate-grpc-for-google-protos:
mkdir -p third_party
git clone https://github.com/googleapis/googleapis.git third_party/googleapis || (cd third_party/googleapis && git reset --hard origin/master && git pull)
mkdir -p ./generated

PATH=bin/:${PATH} bin/protoc/bin/protoc \
-I ./third_party/googleapis \
-I ./apis \
--experimental_allow_proto3_optional \
--grpc-gateway_out ./generated \
--grpc-gateway_opt logtostderr=true \
--grpc-gateway_opt paths=source_relative \
--grpc-gateway_opt standalone=true \
./third_party/googleapis/google/bigtable/admin/v2/*.proto

.PHONY: generate-protos-from-openapi
generate-protos-from-openapi:
mkdir -p temp/
Expand Down
Loading

0 comments on commit 2829c65

Please sign in to comment.