From 0925a88639a7bc57d0e378c009d66d898b08f811 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 1 Dec 2017 15:06:38 -0800 Subject: [PATCH] integration: ignore not found error on cleanup This ignore "not found" errors that may arise during test cleanup. Since the goal is to make the content "not found", it is okay to skip them and not fail the test. Signed-off-by: Stephen J Day --- content_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content_test.go b/content_test.go index 6fc7818ae..5bcfe908e 100644 --- a/content_test.go +++ b/content_test.go @@ -6,6 +6,7 @@ import ( "github.com/containerd/containerd/content" "github.com/containerd/containerd/content/testsuite" + "github.com/containerd/containerd/errdefs" "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.Delete(ctx, info.Digest) + if err := cs.Delete(ctx, info.Digest); err != nil { + if errdefs.IsNotFound(err) { + return nil + } + + return err + } + return nil }) }, nil