Skip to content

Commit 20af59f

Browse files
resolved comments
Signed-off-by: Xiaoxuan Wang <[email protected]>
1 parent de79a2e commit 20af59f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

content/oci/oci.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func (s *Store) GC(ctx context.Context) error {
485485
reachableNodes := s.graph.DigestSet()
486486

487487
// clean up garbage blobs in the storage
488-
rootpath := filepath.Join(s.root, "blobs")
488+
rootpath := filepath.Join(s.root, ocispec.ImageBlobsDir)
489489
algDirs, err := os.ReadDir(rootpath)
490490
if err != nil {
491491
return err
@@ -510,9 +510,8 @@ func (s *Store) GC(ctx context.Context) error {
510510
}
511511
dgst := digestEntry.Name()
512512
blobDigest := digest.NewDigestFromEncoded(digest.Algorithm(alg), dgst)
513-
err := blobDigest.Validate()
514-
// skip irrelevant content
515-
if err != nil {
513+
if err := blobDigest.Validate(); err != nil {
514+
// skip irrelevant content
516515
continue
517516
}
518517
if !reachableNodes.Contains(blobDigest) {

0 commit comments

Comments
 (0)