From 55d17ba3bf92852c406da42703594f425465582f Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Fri, 15 May 2015 13:53:19 +0100 Subject: [PATCH] separate proxy package into weaveproxy and proxy --- .gitignore | 3 ++- Makefile | 13 +++++++------ weave | 2 +- weaveexec/Dockerfile | 2 +- {weaveexec => weaveproxy}/main.go | 0 5 files changed, 11 insertions(+), 9 deletions(-) rename {weaveexec => weaveproxy}/main.go (100%) diff --git a/.gitignore b/.gitignore index 4c848836..6f39f896 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ coverage.html # Project specific weaver/weaver weavedns/weavedns +weaveproxy/weaveproxy sigproxy/sigproxy weavewait/weavewait tools/bin @@ -40,8 +41,8 @@ releases weave.tar weavedns.tar weaveexec.tar -weaveexec/proxy weaveexec/weave +weaveexec/weaveproxy weaveexec/weavewait weaveexec/sigproxy weaveexec/docker*.tgz diff --git a/Makefile b/Makefile index cec7e20f..463ba6cd 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ DOCKERHUB_USER=weaveworks WEAVE_VERSION=git-$(shell git rev-parse --short=12 HEAD) WEAVER_EXE=weaver/weaver WEAVEDNS_EXE=weavedns/weavedns +WEAVEPROXY_EXE=weaveproxy/weaveproxy SIGPROXY_EXE=sigproxy/sigproxy -PROXY_EXE=weaveexec/proxy WEAVEWAIT_EXE=weavewait/weavewait WEAVER_IMAGE=$(DOCKERHUB_USER)/weave WEAVEDNS_IMAGE=$(DOCKERHUB_USER)/weavedns @@ -29,9 +29,9 @@ all: $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVEEXEC_EXPORT) travis: $(WEAVER_EXE) $(WEAVEDNS_EXE) update: - go get -u -f -v -tags -netgo ./$(dir $(WEAVER_EXE)) ./$(dir $(WEAVEDNS_EXE)) ./$(dir $(SIGPROXY_EXE)) ./$(dir $(PROXY_EXE)) + go get -u -f -v -tags -netgo ./$(dir $(WEAVER_EXE)) ./$(dir $(WEAVEDNS_EXE)) ./$(dir $(SIGPROXY_EXE)) ./$(dir $(WEAVEPROXY_EXE)) -$(WEAVER_EXE) $(WEAVEDNS_EXE) $(PROXY_EXE) $(WEAVEWAIT_EXE): common/*.go +$(WEAVER_EXE) $(WEAVEDNS_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE): common/*.go go get -tags netgo ./$(@D) go build -ldflags "-extldflags \"-static\" -X main.version $(WEAVE_VERSION)" -tags netgo -o $@ ./$(@D) @strings $@ | grep cgo_stub\\\.go >/dev/null || { \ @@ -45,7 +45,7 @@ $(WEAVER_EXE) $(WEAVEDNS_EXE) $(PROXY_EXE) $(WEAVEWAIT_EXE): common/*.go $(WEAVER_EXE): router/*.go ipam/*.go ipam/*/*.go weaver/main.go $(WEAVEDNS_EXE): nameserver/*.go weavedns/main.go -$(PROXY_EXE): proxy/*.go weaveexec/main.go +$(WEAVEPROXY_EXE): proxy/*.go weaveproxy/main.go $(WEAVEWAIT_EXE): weavewait/*.go weavewait/main.go # Sigproxy needs separate rule as it fails the netgo check in the main @@ -61,10 +61,11 @@ $(WEAVEDNS_EXPORT): weavedns/Dockerfile $(WEAVEDNS_EXE) $(SUDO) docker build -t $(WEAVEDNS_IMAGE) weavedns $(SUDO) docker save $(WEAVEDNS_IMAGE):latest > $@ -$(WEAVEEXEC_EXPORT): weaveexec/Dockerfile $(DOCKER_DISTRIB) weave $(SIGPROXY_EXE) $(PROXY_EXE) $(WEAVEWAIT_EXE) +$(WEAVEEXEC_EXPORT): weaveexec/Dockerfile $(DOCKER_DISTRIB) weave $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) cp weave weaveexec/weave cp $(SIGPROXY_EXE) weaveexec/sigproxy cp $(WEAVEWAIT_EXE) weaveexec/weavewait + cp $(WEAVEPROXY_EXE) weaveexec/weaveproxy cp $(DOCKER_DISTRIB) weaveexec/docker.tgz $(SUDO) docker build -t $(WEAVEEXEC_IMAGE) weaveexec $(SUDO) docker save $(WEAVEEXEC_IMAGE):latest > $@ @@ -97,7 +98,7 @@ publish: $(PUBLISH) clean: -$(SUDO) docker rmi $(WEAVER_IMAGE) $(WEAVEDNS_IMAGE) $(WEAVEEXEC_IMAGE) - rm -f $(WEAVER_EXE) $(WEAVEDNS_EXE) $(SIGPROXY_EXE) $(PROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVEEXEC_EXPORT) + rm -f $(WEAVER_EXE) $(WEAVEDNS_EXE) $(SIGPROXY_EXE) $(WEAVEPROXY_EXE) $(WEAVEWAIT_EXE) $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVEEXEC_EXPORT) build: $(SUDO) go clean -i net diff --git a/weave b/weave index d8e0554b..744df836 100755 --- a/weave +++ b/weave @@ -730,7 +730,7 @@ ensure_proxy_running() { --name=$PROXY_CONTAINER_NAME \ -p $PROXY_PORT:$PROXY_PORT/tcp -v /var/run/docker.sock:/var/run/docker.sock \ -v /proc:/hostproc -e PROCFS=/hostproc \ - --entrypoint=/home/weave/proxy \ + --entrypoint=/home/weave/weaveproxy \ $WEAVE_DOCKER_ARGS $WEAVEPROXY_DOCKER_ARGS \ $EXEC_IMAGE "$@") diff --git a/weaveexec/Dockerfile b/weaveexec/Dockerfile index 03c5fa24..65b0f47a 100644 --- a/weaveexec/Dockerfile +++ b/weaveexec/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /home/weave ADD ./weave /home/weave/ ADD ./sigproxy /home/weave/ -ADD ./proxy /home/weave/ +ADD ./weaveproxy /home/weave/ ADD ./weavewait /home/weavewait/weavewait ADD ./docker.tgz / diff --git a/weaveexec/main.go b/weaveproxy/main.go similarity index 100% rename from weaveexec/main.go rename to weaveproxy/main.go