Skip to content

Commit

Permalink
enable remove action for "created" state containers
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed Jan 11, 2018
1 parent eb49e51 commit 6d37a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions container/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion menus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
}
Expand Down

0 comments on commit 6d37a4e

Please sign in to comment.