Fix Docker provider mem leak on operation retries
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
adf82d72ae
commit
d3e4d56a0d
1 changed files with 2 additions and 1 deletions
|
@ -205,6 +205,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.
|
||||||
logger.Errorf("Failed to create a client for docker, error: %s", err)
|
logger.Errorf("Failed to create a client for docker, error: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer dockerClient.Close()
|
||||||
|
|
||||||
serverVersion, err := dockerClient.ServerVersion(ctx)
|
serverVersion, err := dockerClient.ServerVersion(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -249,7 +250,7 @@ func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
services, err := p.listServices(ctx, dockerClient)
|
services, err := p.listServices(ctx, dockerClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("Failed to list services for docker, error %s", err)
|
logger.Errorf("Failed to list services for docker swarm mode, error %s", err)
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue