From a12781e0bb974babaa4268ed74c5fe11bdc52fb6 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Mon, 10 Nov 2014 18:29:36 -0800 Subject: [PATCH] fix firewall --- firewall/Dockerfile | 5 +---- firewall/main.go | 17 ++++------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/firewall/Dockerfile b/firewall/Dockerfile index 1a90798..810c851 100644 --- a/firewall/Dockerfile +++ b/firewall/Dockerfile @@ -2,10 +2,7 @@ FROM golang:latest MAINTAINER Jessica Frazelle 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 diff --git a/firewall/main.go b/firewall/main.go index 24927c2..4132eaf 100644 --- a/firewall/main.go +++ b/firewall/main.go @@ -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) } }