Skip to content

Commit

Permalink
Merge pull request #368 from changweige/print-error-digest
Browse files Browse the repository at this point in the history
print the invalid blob digest to log
  • Loading branch information
changweige committed Feb 22, 2023
2 parents 16ca123 + 87c8299 commit 9fb0d50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/filesystem/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ func (fs *Filesystem) Umount(ctx context.Context, snapshotID string) error {
func (fs *Filesystem) CacheUsage(ctx context.Context, blobDigest string) (snapshots.Usage, error) {
digest := digest.Digest(blobDigest)
if err := digest.Validate(); err != nil {
return snapshots.Usage{}, errors.Wrapf(err, "invalid blob digest from label %s", snpkg.TargetLayerDigestLabel)
return snapshots.Usage{}, errors.Wrapf(err, "invalid blob digest from label %s, digest=%s",
snpkg.TargetLayerDigestLabel, blobDigest)
}
blobID := digest.Hex()
return fs.cacheMgr.CacheUsage(ctx, blobID)
Expand All @@ -341,7 +342,8 @@ func (fs *Filesystem) CacheUsage(ctx context.Context, blobDigest string) (snapsh
func (fs *Filesystem) RemoveCache(blobDigest string) error {
digest := digest.Digest(blobDigest)
if err := digest.Validate(); err != nil {
return errors.Wrapf(err, "invalid blob digest from label %s", snpkg.TargetLayerDigestLabel)
return errors.Wrapf(err, "invalid blob digest from label %s. digest=%s",
snpkg.TargetLayerDigestLabel, blobDigest)
}
blobID := digest.Hex()
if config.GetFsDriver() == config.FsDriverFscache {
Expand Down

0 comments on commit 9fb0d50

Please sign in to comment.