Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Jan 9, 2024
1 parent 9a2b4c6 commit 40ad281
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion content/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ func (s *Store) GC(ctx context.Context) error {
dgst := dgstDir.Name()
blobDigest := digest.NewDigestFromEncoded(digest.Algorithm(alg), dgst)
err := blobDigest.Validate()
// skip unsupported directories
// skip irrelevant content
if err != nil {
continue
}
Expand Down
4 changes: 2 additions & 2 deletions content/oci/oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3016,15 +3016,15 @@ func TestStore_GCErrorPath(t *testing.T) {
t.Error("failed to push test content to src")
}

// test os.ReadDir() error
// unknown algorithm
if err := os.Mkdir(path.Join(algPath, "sha666"), 0777); err != nil {
t.Fatal(err)
}
if err = s.GC(ctx); err != nil {
t.Fatal("this error should be silently ignored")
}

// test os.Remove() error
// os.Remove() error
badDigest := digest.FromBytes([]byte("bad digest")).Encoded()
badPath := path.Join(algPath, "sha256", badDigest)
if err := os.Mkdir(badPath, 0777); err != nil {
Expand Down

0 comments on commit 40ad281

Please sign in to comment.