From 6d37a4e333c9b26301fd4e9116179b618fe215a8 Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Thu, 11 Jan 2018 14:40:21 +0000 Subject: [PATCH] enable remove action for "created" state containers --- container/main.go | 6 ++---- menus.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/container/main.go b/container/main.go index 62fb9e2..a576e70 100644 --- a/container/main.go +++ b/container/main.go @@ -110,9 +110,7 @@ func (c *Container) Stop() { } func (c *Container) Remove() { - if c.Meta["state"] == "exited" { - if err := c.manager.Remove(); err != nil { - log.Warningf("container %s: %v", c.Id, err) - } + if err := c.manager.Remove(); err != nil { + log.Warningf("container %s: %v", c.Id, err) } } diff --git a/menus.go b/menus.go index 47eaece..cb1cbcd 100644 --- a/menus.go +++ b/menus.go @@ -129,7 +129,7 @@ func ContainerMenu() MenuFn { if c.Meta["state"] == "running" { items = append(items, menu.Item{Val: "stop", Label: "stop"}) } - if c.Meta["state"] == "exited" { + if c.Meta["state"] == "exited" || c.Meta["state"] == "created" { items = append(items, menu.Item{Val: "start", Label: "start"}) items = append(items, menu.Item{Val: "remove", Label: "remove"}) }