Skip to content

Commit

Permalink
v1.4.2 (#65)
Browse files Browse the repository at this point in the history
* resolved #62 (#63)

* use a specific version (1.25.5) of Docker Compose as the base image for Pico (#64)

* use docker compose 1.25.1 (#66)
  • Loading branch information
Southclaws authored Jun 17, 2020
1 parent 20ca435 commit 82a8a02
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM docker/compose
FROM docker/compose:1.25.1
COPY pico /
ENTRYPOINT ["/pico"]
14 changes: 12 additions & 2 deletions reconfigurer/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,25 @@ func (p *GitProvider) watchConfig() (err error) {
return errors.Wrap(err, "failed to watch config target")
}

errs := make(chan error)
go func() {
e := p.configWatcher.Run()
if e != nil && !errors.Is(e, context.Canceled) {
zap.L().Error("config watcher failed", zap.Error(e))
errs <- e
}
// TODO: forward these errors elsewhere.
for e = range p.configWatcher.Errors {
zap.L().Error("config watcher error occurred", zap.Error(e))
}
}()
zap.L().Debug("created new config watcher, awaiting setup")

<-p.configWatcher.InitialDone
select {
case <-p.configWatcher.InitialDone:
case err = <-errs:
}

zap.L().Debug("config watcher initialised")

return
}
Expand Down
10 changes: 8 additions & 2 deletions watcher/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,21 @@ func (w *GitWatcher) watchTargets() (err error) {
return errors.Wrap(err, "failed to watch targets")
}

errs := make(chan error)
go func() {
e := w.targetsWatcher.Run()
if e != nil && !errors.Is(e, context.Canceled) {
w.errors <- e
errs <- e
}
// forward errors from the watcher to the central for-select above
w.errors <- <-w.targetsWatcher.Errors
}()
zap.L().Debug("created targets watcher, awaiting setup")

<-w.targetsWatcher.InitialDone
select {
case <-w.targetsWatcher.InitialDone:
case err = <-errs:
}

zap.L().Debug("targets watcher initialised")

Expand Down

0 comments on commit 82a8a02

Please sign in to comment.