mirror of
https://github.com/containous/traefik.git
synced 2025-08-24 09:49:31 +03:00
Don't reload configuration when rancher server is down
This commit is contained in:
committed by
Traefiker
parent
ae34486b57
commit
fc00e1c228
@ -91,11 +91,15 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
checkAPI, errAPI := rancherClient.ApiKey.List(withoutPagination)
|
||||
|
||||
log.Debugf("Refreshing new Data from Provider API")
|
||||
var stacks = listRancherStacks(rancherClient)
|
||||
var services = listRancherServices(rancherClient)
|
||||
var container = listRancherContainer(rancherClient)
|
||||
if errAPI != nil {
|
||||
log.Errorf("Cannot establish connection: %+v, Rancher API return: %+v; Skipping refresh Data from Rancher API.", errAPI, checkAPI)
|
||||
} else {
|
||||
log.Debugf("Refreshing new Data from Rancher API")
|
||||
stacks := listRancherStacks(rancherClient)
|
||||
services := listRancherServices(rancherClient)
|
||||
container := listRancherContainer(rancherClient)
|
||||
|
||||
rancherData := parseAPISourcedRancherData(stacks, services, container)
|
||||
|
||||
@ -106,6 +110,7 @@ func (p *Provider) apiProvide(configurationChan chan<- types.ConfigMessage, pool
|
||||
Configuration: configuration,
|
||||
}
|
||||
}
|
||||
}
|
||||
case <-stop:
|
||||
ticker.Stop()
|
||||
cancel()
|
||||
|
Reference in New Issue
Block a user