fix firewall

This commit is contained in:
Jessica Frazelle 2014-11-10 18:29:36 -08:00
parent 4ef885c215
commit a12781e0bb
2 changed files with 5 additions and 17 deletions

View File

@ -2,10 +2,7 @@ FROM golang:latest
MAINTAINER Jessica Frazelle <jess@docker.com>
RUN go get github.com/Sirupsen/logrus
RUN go get github.com/coreos/go-etcd/etcd && \
cd /go/src/github.com/coreos/go-etcd && \
git checkout 6654a8c3055c6154c3f9dfd78c852ada46a2bed0 && \
go install github.com/coreos/go-etcd/etcd
RUN go get github.com/coreos/go-etcd/etcd
ADD ./main.go /src/main.go

View File

@ -6,7 +6,6 @@ import (
"fmt"
"os"
"os/exec"
"time"
"github.com/Sirupsen/logrus"
"github.com/coreos/go-etcd/etcd"
@ -148,18 +147,10 @@ func main() {
logger.Fatal(err)
}
// run in a loop incase we have network issues connecting to etcd
for i := 0; i < 100; i++ {
update := make(chan *etcd.Response, 10)
go processLoop(client, update)
update := make(chan *etcd.Response)
go processLoop(client, update)
if _, err := client.Watch("/firewall", 0, true, update, nil); err != nil {
logger.Error(err)
}
close(update)
time.Sleep(10 * time.Second)
logger.Infof("restarting process loop %d times", i)
if _, err := client.Watch("/firewall", 0, true, update, nil); err != nil {
logger.Error(err)
}
}