Merge pull request #1860 from stevvooe/ignore-not-found

integration: ignore not found error on cleanup
This commit is contained in:
Michael Crosby 2017-12-01 18:33:58 -05:00 committed by GitHub
commit 96572395ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ import (
"github.com/containerd/containerd/content" "github.com/containerd/containerd/content"
"github.com/containerd/containerd/content/testsuite" "github.com/containerd/containerd/content/testsuite"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
@ -28,7 +29,14 @@ func newContentStore(ctx context.Context, root string) (content.Store, func() er
} }
} }
return cs.Walk(ctx, func(info content.Info) error { return cs.Walk(ctx, func(info content.Info) error {
return cs.Delete(ctx, info.Digest) if err := cs.Delete(ctx, info.Digest); err != nil {
if errdefs.IsNotFound(err) {
return nil
}
return err
}
return nil
}) })
}, nil }, nil