Skip to content

Commit

Permalink
codegen: use new cilium-builder image
Browse files Browse the repository at this point in the history
The new cilium-builder image embeds the protoc-gen-doc plugin. This
means that we don't need a separate `doc` target as documentation is
generated along with the code.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
rolinh authored and jrfastab committed Jun 2, 2022

Verified

This commit was signed with the committer’s verified signature.
slarse Simon Larsén
1 parent 6ce5939 commit eea2ebd
Showing 6 changed files with 218 additions and 219 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.codegen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/cilium/cilium-builder:b7a9dcdcadd77d38db87bbd06b9bc238e9dab5a0@sha256:eecc017a6ccf0c7884f1ffcf10e58462a272f5e41c0ece09adb351e8839e3157
FROM quay.io/cilium/cilium-builder:b7d0138c0c9bd5ed791117d924e57e99fe078b63@sha256:448b7ba8e7ae1628419b5857b80ad5c3c931d32835ea637095b1503acd0e68f7
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/tetragon cd /go/src/github.com/cilium/tetragon && go install ./cmd/protoc-gen-go-tetragon

#- vi:ft=dockerfile -#
10 changes: 1 addition & 9 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
BUILDER_IMAGE=cilium/tetragon-codegen:latest

.PHONY: all
all: proto doc
all: proto

.PHONY: proto
proto: v1
@@ -16,11 +16,3 @@ v1:
--user "$(shell id -u):$(shell id -g)" \
$(BUILDER_IMAGE) \
make -C /src -f Makefile.protoc

.PHONY: doc
doc:
docker container run --rm \
--volume $(CURDIR)/v1:/out \
--volume $(CURDIR)/v1/tetragon:/protos \
pseudomuto/protoc-gen-doc:1.5.0 \
--doc_opt=markdown,README.md
3 changes: 3 additions & 0 deletions api/v1/Makefile.protoc
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ TETRAGON_GO_TARGETS := \
TETRAGON_PROTO_PATH := .

TETRAGON_PROTOC_PLUGINS := \
--plugin=$(GOPATH)/bin/protoc-gen-doc \
--plugin=$(GOPATH)/bin/protoc-gen-go \
--plugin=$(GOPATH)/bin/protoc-gen-go-grpc \
--plugin=$(GOPATH)/bin/protoc-gen-go-json \
@@ -21,6 +22,8 @@ all:
for proto in $(TETRAGON_PROTO_SOURCES) ; do \
echo Generating $${proto} && \
$(PROTOC) $(TETRAGON_PROTOC_PLUGINS) -I $(TETRAGON_PROTO_PATH) \
--doc_out=./ \
--doc_opt=markdown,README.md \
--go_out=paths=source_relative:. \
--go-grpc_out=require_unimplemented_servers=false,paths=source_relative:. \
--go-json_out=orig_name=true,paths=source_relative:. \
414 changes: 207 additions & 207 deletions api/v1/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/v1/tetragon/tetragon.pb.go
4 changes: 4 additions & 0 deletions api/v1/tetragon/tetragon_grpc.pb.go

0 comments on commit eea2ebd

Please sign in to comment.