From 6eeb21f87e4eb3a7675105af27a22c33e63e9770 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Wed, 17 Apr 2019 18:30:46 -0700 Subject: [PATCH] rm: remove builder even if driver is not responsive Signed-off-by: Tonis Tiigi --- commands/rm.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/rm.go b/commands/rm.go index abd8bfde..1d49fbd6 100644 --- a/commands/rm.go +++ b/commands/rm.go @@ -27,10 +27,11 @@ func runRm(dockerCli command.Cli, in rmOptions, args []string) error { if err != nil { return err } - if err := stop(ctx, dockerCli, ng, true); err != nil { + err1 := stop(ctx, dockerCli, ng, true) + if err := txn.Remove(ng.Name); err != nil { return err } - return txn.Remove(ng.Name) + return err1 } ng, err := getCurrentInstance(txn, dockerCli) @@ -38,10 +39,11 @@ func runRm(dockerCli command.Cli, in rmOptions, args []string) error { return err } if ng != nil { - if err := stop(ctx, dockerCli, ng, true); err != nil { + err1 := stop(ctx, dockerCli, ng, true) + if err := txn.Remove(ng.Name); err != nil { return err } - return txn.Remove(ng.Name) + return err1 } return nil