Skip to content

Commit

Permalink
fix: export ErrSkipDesc
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle M. Tarplee <[email protected]>
  • Loading branch information
ktarplee committed Oct 31, 2023
1 parent 062ed0e commit 7ca7f2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ca7f2c

Please sign in to comment.