Skip to content

Commit

Permalink
fix(hatchery/swarm): improve some logs (#4303)
Browse files Browse the repository at this point in the history
Hatchery swarm: avoid error log if a container is already under deletion.
  • Loading branch information
yesnault authored and richardlt committed May 20, 2019
1 parent b5c1357 commit 5939697
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/hatchery/swarm/swarm_util_kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ func (h *HatcherySwarm) killAndRemoveContainer(dockerClient *dockerClient, ID st
defer cancelList()
if err := dockerClient.ContainerRemove(ctxDockerRemove, ID, types.ContainerRemoveOptions{Force: true}); err != nil {
// container could be already removed by a previous call to docker
if !strings.Contains(err.Error(), "No such container") {
return sdk.WrapError(err, "Unable to remove container %s form %s", ID, dockerClient.name)
if !strings.Contains(err.Error(), "No such container") && !strings.Contains(err.Error(), "is already in progress") {
return sdk.WrapError(err, "Unable to remove container %s from %s", ID, dockerClient.name)
}
}

Expand Down

0 comments on commit 5939697

Please sign in to comment.