Skip to content

Commit

Permalink
Always purge stopped containers
Browse files Browse the repository at this point in the history
  • Loading branch information
clinta committed Aug 31, 2017
1 parent 473e003 commit 786c09f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1275,10 +1275,11 @@ CREATE:
containerName := "/" + config.Name
d.logger.Printf("[DEBUG] driver.docker: searching for container name %q to purge", containerName)
for _, shimContainer := range containers {
d.logger.Printf("[DEBUG] driver.docker: listed container %+v", container)
d.logger.Printf("[DEBUG] driver.docker: listed container %+v", shimContainer.Names)
found := false
for _, name := range shimContainer.Names {
if name == containerName {
d.logger.Printf("[DEBUG] driver.docker: Found container %v: %v", containerName, shimContainer.ID)
found = true
break
}
Expand All @@ -1300,7 +1301,7 @@ CREATE:
// See #2802
return nil, structs.NewRecoverableError(err, true)
}
if container != nil && (container.State.Running || container.State.FinishedAt.IsZero()) {
if container != nil && container.State.Running {
return container, nil
}

Expand Down

0 comments on commit 786c09f

Please sign in to comment.