Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2888 from hashicorp/b-docker-crash
Browse files Browse the repository at this point in the history
builtin/docker: fix crash during stop task with ODR
  • Loading branch information
mitchellh authored Jan 7, 2022
2 parents 0fefb0c + 8d15d38 commit b99c6fe
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions builtin/docker/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,13 @@ func (b *TaskLauncher) StopTask(
if err := cli.ContainerRemove(ctx, ti.Id, types.ContainerRemoveOptions{
Force: true,
}); err != nil {
// "removal of container already in progress" is the error when
// the daemon is removing this for some reason (auto remove or
// other). This is not an error.
if strings.Contains(err.Error(), "already in progress") {
// "removal of container already in progress" is the error when
// the daemon is removing this for some reason (auto remove or
// other). This is not an error.
err = nil
}

// Container is already removed
if strings.Contains(strings.ToLower(err.Error()), "no such container") {
} else if strings.Contains(strings.ToLower(err.Error()), "no such container") {
// Container is already removed
err = nil
}

Expand Down Expand Up @@ -358,6 +356,7 @@ func (b *TaskLauncher) StartTask(
"oci-url", tli.OciUrl,
"arguments", tli.Arguments,
"environment", env,
"autoremove", !b.config.DebugContainers,
)

var memory int64
Expand Down

0 comments on commit b99c6fe

Please sign in to comment.