Merge pull request #1200 from stevvooe/image-is-found

cmd/ctr: container list should not look up image
This commit is contained in:
Derek McGowan 2017-07-17 16:14:43 -07:00 committed by GitHub
commit 6d305c741e

View File

@ -6,7 +6,6 @@ import (
"strings" "strings"
"text/tabwriter" "text/tabwriter"
"github.com/containerd/containerd"
tasks "github.com/containerd/containerd/api/services/tasks/v1" tasks "github.com/containerd/containerd/api/services/tasks/v1"
"github.com/urfave/cli" "github.com/urfave/cli"
) )
@ -118,14 +117,9 @@ func containerListFn(context *cli.Context) error {
labels = "-" labels = "-"
} }
var imageName string imageName := c.Info().Image
if image, err := c.Image(ctx); err != nil { if imageName == "" {
if err != containerd.ErrNoImage {
return err
}
imageName = "-" imageName = "-"
} else {
imageName = image.Name()
} }
record := c.Info() record := c.Info()