mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
fix firewall
This commit is contained in:
parent
4ef885c215
commit
a12781e0bb
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user