Skip to content

Commit

Permalink
fixing bug on multiple containers simultaneously upgrade. Can't prune…
Browse files Browse the repository at this point in the history
… multiple times. Replaced with container remove
  • Loading branch information
igorrendulic committed Oct 28, 2020
1 parent 16ab25c commit 34b04e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ func (cl *Client) ContainerReplace(containerID string, image string, tag string)
return sErr
}

_, remErr := cl.ContainersPrune(filters.NewArgs())
remErr := cl.ContainerRemove(containerID)
if remErr != nil {
if cl.log != nil {
cl.log.Error("failed to remove old container", containerID, remErr)
Expand All @@ -613,7 +613,7 @@ func (cl *Client) ContainerRemove(containerID string) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()

remErr := cl.client.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true, RemoveLinks: true})
remErr := cl.client.ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{Force: true, RemoveVolumes: true})
if remErr != nil {
if cl.log != nil {
cl.log.Error("failed to remove old container", containerID, remErr)
Expand Down

0 comments on commit 34b04e3

Please sign in to comment.