Skip to content

Commit

Permalink
Merge pull request #1335 from hashicorp/f-set-docker-timeout
Browse files Browse the repository at this point in the history
Setting a timeout in the docker client
  • Loading branch information
diptanu authored Jun 22, 2016
2 parents e73463a + f385e33 commit 964e133
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,25 @@ func (d *DockerDriver) dockerClients() (*docker.Client, *docker.Client, error) {
if cert+key+ca != "" {
d.logger.Printf("[DEBUG] driver.docker: using TLS client connection to %s", dockerEndpoint)
client, err = docker.NewTLSClient(dockerEndpoint, cert, key, ca)
if err != nil {
merr.Errors = append(merr.Errors, err)
}
waitClient, err = docker.NewTLSClient(dockerEndpoint, cert, key, ca)
if err != nil {
merr.Errors = append(merr.Errors, err)
}
} else {
d.logger.Printf("[DEBUG] driver.docker: using standard client connection to %s", dockerEndpoint)
client, err = docker.NewClient(dockerEndpoint)
if err != nil {
merr.Errors = append(merr.Errors, err)
}
waitClient, err = docker.NewClient(dockerEndpoint)
if err != nil {
merr.Errors = append(merr.Errors, err)
}
}
client.HTTPClient.Timeout = dockerTimeout
client.SetTimeout(dockerTimeout)
return
}

Expand All @@ -277,7 +291,7 @@ func (d *DockerDriver) dockerClients() (*docker.Client, *docker.Client, error) {
if err != nil {
merr.Errors = append(merr.Errors, err)
}
client.HTTPClient.Timeout = dockerTimeout
client.SetTimeout(dockerTimeout)

waitClient, err = docker.NewClientFromEnv()
if err != nil {
Expand Down

0 comments on commit 964e133

Please sign in to comment.