Skip to content

Commit

Permalink
Add make target to generate CRI files
Browse files Browse the repository at this point in the history
The cri make target generates the api.pb.go files by first fetching the
latest proto files from upstream and uses protoc to generate them.
  • Loading branch information
lilic committed Jul 26, 2018
1 parent acfc2a0 commit 31d68c4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all deps static clean realclean client-lint client-test client-sync backend frontend shell lint ui-upload
.PHONY: all cri deps static clean realclean client-lint client-test client-sync backend frontend shell lint ui-upload

# If you can use Docker without being root, you can `make SUDO= <target>`
SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E")
Expand Down Expand Up @@ -45,6 +45,16 @@ IMAGE_TAG=$(shell ./tools/image-tag)

all: $(SCOPE_EXPORT)

update-cri:
curl https://raw.githubusercontent.com/kubernetes/kubernetes/master/pkg/kubelet/apis/cri/runtime/v1alpha2/api.proto > cri/runtime/api.proto

protoc-gen-gofast:
@go get -u -v github.com/gogo/protobuf/protoc-gen-gofast

# Use cri target to download latest cri proto files and regenerate CRI runtime files.
cri: update-cri protoc-gen-gofast
@cd $(GOPATH)/src;protoc --proto_path=$(GOPATH)/src --gofast_out=plugins=grpc:. github.com/weaveworks/scope/cri/runtime/api.proto

docker/weave:
curl -L https://github.com/weaveworks/weave/releases/download/v$(WEAVENET_VERSION)/weave -o docker/weave
chmod u+x docker/weave
Expand Down

0 comments on commit 31d68c4

Please sign in to comment.