Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update protobuf and gRPC related dependencies #12767

Merged
merged 2 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 5 additions & 16 deletions api/v1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,22 @@ HUBBLE_GO_TARGETS := $(HUBBLE_PROTO_SOURCES:.proto=.pb.go) $(HUBBLE_PROTO_SOURCE

HUBBLE_PROTO_PATH := .

HUBBLE_PROTOC_PLUGINS := --plugin=../../tools/protoc-gen-go
HUBBLE_PROTOC_PLUGINS := --plugin=../../tools/protoc-gen-go-grpc
HUBBLE_PROTOC_PLUGINS += --plugin=../../tools/protoc-gen-go-json
HUBBLE_PROTOC_PLUGINS += --plugin=../../tools/protoc-gen-validate

PROTO_DEPS = \
-I external

RAW_GO_MAPPINGS += google/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp/
RAW_GO_MAPPINGS += google/protobuf/wrappers.proto=github.com/golang/protobuf/ptypes/wrappers/
RAW_GO_MAPPINGS += flow/flow.proto=github.com/cilium/cilium/api/v1/flow/
RAW_GO_MAPPINGS += observer/observer.proto=github.com/cilium/cilium/api/v1/observer/
RAW_GO_MAPPINGS += relay/relay.proto=github.com/cilium/cilium/api/v1/relay/

# Add mapping separators and remove the trailing slash
# but first create "/ " and ",M"
null :=
space := ${null} ${null}
file_sep := /${space}
map_sep := ,M
GO_MAPPINGS := $(patsubst %/,%,$(map_sep)$(subst $(file_sep),$(map_sep),$(RAW_GO_MAPPINGS)))

$(HUBBLE_GO_TARGETS): $(HUBBLE_PROTO_SOURCES) Makefile deps
@echo NOTE: The warning about package github.com/golang/protobuf/protoc-gen-go/generator can be ignored; \
$(QUIET)set -e; \
for proto in $(HUBBLE_PROTO_SOURCES) ; do \
$(PROTOC) $(HUBBLE_PROTOC_PLUGINS) -I $(HUBBLE_PROTO_PATH) $(PROTO_DEPS) \
--go_out=plugins=grpc$(GO_MAPPINGS):. --validate_out=lang=go$(GO_MAPPINGS):. --go-json_out=orig_name:. \
--go_out=paths=source_relative:. \
--go-grpc_out=paths=source_relative:. \
--go-json_out=orig_name:. \
--validate_out=lang=go,paths=source_relative:. \
$${proto}; \
done

Expand Down
8 changes: 5 additions & 3 deletions api/v1/flow/flow.pb.go

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

2 changes: 2 additions & 0 deletions api/v1/flow/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import "google/protobuf/timestamp.proto";

package flow;

option go_package = "github.com/cilium/cilium/api/v1/flow";

message Flow {
google.protobuf.Timestamp time = 1;
Verdict verdict = 2;
Expand Down
161 changes: 6 additions & 155 deletions api/v1/observer/observer.pb.go

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

2 changes: 2 additions & 0 deletions api/v1/observer/observer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import "relay/relay.proto";

package observer;

option go_package = "github.com/cilium/cilium/api/v1/observer";

// Observer returns a stream of Payload depending on which filter the user
// want to observer.
service Observer {
Expand Down