From 7ca7f2ca257c21ad69a6a49de2b5438dd7699852 Mon Sep 17 00:00:00 2001 From: "Kyle M. Tarplee" Date: Tue, 31 Oct 2023 07:57:58 -0400 Subject: [PATCH] fix: export ErrSkipDesc Signed-off-by: Kyle M. Tarplee --- copy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/copy.go b/copy.go index ca0f5d6f..52277542 100644 --- a/copy.go +++ b/copy.go @@ -37,8 +37,8 @@ import ( // defaultConcurrency is the default value of CopyGraphOptions.Concurrency. const defaultConcurrency int = 3 // This value is consistent with dockerd and containerd. -// errSkipDesc signals copyNode() to stop processing a descriptor. -var errSkipDesc = errors.New("skip descriptor") +// ErrSkipDesc signal to stop copying a descriptor. When returned from PreCopy the blob must exist in the target. +var ErrSkipDesc = errors.New("skip descriptor") // DefaultCopyOptions provides the default CopyOptions. var DefaultCopyOptions CopyOptions = CopyOptions{ @@ -281,7 +281,7 @@ func doCopyNode(ctx context.Context, src content.ReadOnlyStorage, dst content.St func copyNode(ctx context.Context, src content.ReadOnlyStorage, dst content.Storage, desc ocispec.Descriptor, opts CopyGraphOptions) error { if opts.PreCopy != nil { if err := opts.PreCopy(ctx, desc); err != nil { - if err == errSkipDesc { + if err == ErrSkipDesc { return nil } return err @@ -373,7 +373,7 @@ func prepareCopy(ctx context.Context, dst Target, dstRef string, proxy *cas.Prox } } // skip the regular copy workflow - return errSkipDesc + return ErrSkipDesc } } else { postCopy := opts.PostCopy