Merge pull request #949 from stevvooe/continue-on-error

cmd/dist: don't display undeleted images
This commit is contained in:
Stephen Day 2017-06-01 17:58:38 -07:00 committed by GitHub
commit 12c596be29

10
cmd/dist/images.go vendored
View File

@ -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)