From 31d68c44a2620e5ff1365d3afeb06953cfc3550b Mon Sep 17 00:00:00 2001 From: Lili Cosic Date: Fri, 20 Jul 2018 07:30:18 +0200 Subject: [PATCH] Add make target to generate CRI files 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. --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ea2a30ab7..b08fc43e6 100644 --- a/Makefile +++ b/Makefile @@ -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= ` SUDO=$(shell docker info >/dev/null 2>&1 || echo "sudo -E") @@ -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