mirror of
https://github.com/containous/traefik.git
synced 2025-01-11 05:17:52 +03:00
Return errors from Docker client.Events
This commit is contained in:
parent
bcadd68904
commit
56c0634918
@ -2,6 +2,7 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -237,16 +238,22 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
|
|||||||
}
|
}
|
||||||
|
|
||||||
eventsc, errc := dockerClient.Events(ctx, options)
|
eventsc, errc := dockerClient.Events(ctx, options)
|
||||||
for event := range eventsc {
|
for {
|
||||||
if event.Action == "start" ||
|
select {
|
||||||
event.Action == "die" ||
|
case event := <-eventsc:
|
||||||
strings.HasPrefix(event.Action, "health_status") {
|
if event.Action == "start" ||
|
||||||
startStopHandle(event)
|
event.Action == "die" ||
|
||||||
|
strings.HasPrefix(event.Action, "health_status") {
|
||||||
|
startStopHandle(event)
|
||||||
|
}
|
||||||
|
case err := <-errc:
|
||||||
|
if err == io.EOF {
|
||||||
|
log.Debug("Provider event stream closed")
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := <-errc; err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user