Support stop chan on docker provider

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2016-04-16 14:46:35 +02:00
parent f2320ee648
commit 4144638be4
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3

View file

@ -130,6 +130,15 @@ func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, po
eventHandler.Handle("die", startStopHandle) eventHandler.Handle("die", startStopHandle)
errChan := events.MonitorWithHandler(ctx, dockerClient, options, eventHandler) errChan := events.MonitorWithHandler(ctx, dockerClient, options, eventHandler)
pool.Go(func(stop chan bool) {
for {
select {
case <-stop:
cancel()
return
}
}
})
if err := <-errChan; err != nil { if err := <-errChan; err != nil {
return err return err
} }