enable remove action for "created" state containers

This commit is contained in:
Bradley Cicenas 2018-01-11 14:40:21 +00:00
parent eb49e51ffb
commit 6d37a4e333
2 changed files with 3 additions and 5 deletions

View File

@ -110,9 +110,7 @@ func (c *Container) Stop() {
} }
func (c *Container) Remove() { func (c *Container) Remove() {
if c.Meta["state"] == "exited" { if err := c.manager.Remove(); err != nil {
if err := c.manager.Remove(); err != nil { log.Warningf("container %s: %v", c.Id, err)
log.Warningf("container %s: %v", c.Id, err)
}
} }
} }

View File

@ -129,7 +129,7 @@ func ContainerMenu() MenuFn {
if c.Meta["state"] == "running" { if c.Meta["state"] == "running" {
items = append(items, menu.Item{Val: "stop", Label: "stop"}) 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: "start", Label: "start"})
items = append(items, menu.Item{Val: "remove", Label: "remove"}) items = append(items, menu.Item{Val: "remove", Label: "remove"})
} }