From 640493adbf089b7df024d95456886c8fb4ea973f Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 1 Jun 2017 16:53:55 -0700 Subject: [PATCH] cmd/dist: don't display undeleted images Signed-off-by: Stephen J Day --- cmd/dist/images.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/dist/images.go b/cmd/dist/images.go index b59cdd53f..1cbf5a8ce 100644 --- a/cmd/dist/images.go +++ b/cmd/dist/images.go @@ -6,6 +6,7 @@ import ( "text/tabwriter" "github.com/containerd/containerd/log" + "github.com/containerd/containerd/metadata" "github.com/containerd/containerd/progress" "github.com/pkg/errors" "github.com/urfave/cli" @@ -73,10 +74,13 @@ var rmiCommand = cli.Command{ for _, target := range clicontext.Args() { if err := imageStore.Delete(ctx, target); err != nil { - if exitErr == nil { - exitErr = errors.Wrapf(err, "unable to delete %v", target) + if !metadata.IsNotFound(err) { + if exitErr == nil { + exitErr = errors.Wrapf(err, "unable to delete %v", target) + } + log.G(ctx).WithError(err).Errorf("unable to delete %v", target) + continue } - log.G(ctx).WithError(err).Errorf("unable to delete %v", target) } fmt.Println(target)