Skip to content

Commit

Permalink
Merge pull request #3148 from clinta/purge-stopped
Browse files Browse the repository at this point in the history
Always purge stopped containers
  • Loading branch information
dadgar authored Sep 6, 2017
2 parents 586580f + 786c09f commit d8d4fb8
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 @@ -1305,10 +1305,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 @@ -1330,7 +1331,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 d8d4fb8

Please sign in to comment.