Skip to content

Commit

Permalink
Call callback only for unlazied contents
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <[email protected]>
  • Loading branch information
ktock committed Dec 13, 2024
1 parent 867e8fd commit c00304f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cache/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,11 @@ func getBlobWithCompression(ctx context.Context, cs content.Store, desc ocispecs
}

func walkBlob(ctx context.Context, cs content.Store, desc ocispecs.Descriptor, f func(ocispecs.Descriptor) bool) error {
if _, err := cs.Info(ctx, desc.Digest); errors.Is(err, cerrdefs.ErrNotFound) {
return nil // this blob doesn't exist in the content store. Don't call the callback.
} else if err != nil {
return err
}
if !f(desc) {
return nil
}
Expand Down

0 comments on commit c00304f

Please sign in to comment.