Skip to content

Commit 336e3fc

Browse files
committed
Another attempt to fix dockerdeploy getting stuck during node removal.
1 parent 072571c commit 336e3fc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

deployment/dockerdeploy/controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,17 +711,22 @@ func (c *Controller) RemoveNode(ctx context.Context, containerID string) error {
711711
err := c.DockerCli.ContainerStop(ctx, containerID, container.StopOptions{
712712
Timeout: ptr.To(0),
713713
})
714+
714715
if err != nil {
715716
return errors.Wrap(err, "failed to stop container")
716717
}
717718

718719
logger.Debug("removing container")
719720

720721
// we try to call remove to force it to be removed
721-
c.DockerCli.ContainerRemove(ctx, containerID, container.RemoveOptions{
722+
err = c.DockerCli.ContainerRemove(ctx, containerID, container.RemoveOptions{
722723
Force: true,
723724
})
724725

726+
if err != nil {
727+
return errors.Wrap(err, "failed to remove container")
728+
}
729+
725730
logger.Debug("waiting for container to disappear")
726731

727732
// We call this to 'wait' for the removal to finish...

0 commit comments

Comments
 (0)