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.
This commit is contained in:
Lili Cosic
2018-07-20 07:30:18 +02:00
parent acfc2a0dba
commit 31d68c44a2

View File

@@ -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")
@@ -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