Skip to content

Commit

Permalink
Use digest.*.FromString where possible
Browse files Browse the repository at this point in the history
... instead of doing the same thing manually.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Feb 8, 2024
1 parent 2029a3b commit e0e8045
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion oci/layout/oci_src_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestGetBlobForRemoteLayers(t *testing.T) {
imageSource := createImageSource(t, &types.SystemContext{})
defer imageSource.Close()
layerInfo := types.BlobInfo{
Digest: digest.FromBytes([]byte("Hello world")),
Digest: digest.FromString("Hello world"),
Size: -1,
URLs: []string{
"brokenurl",
Expand Down
2 changes: 1 addition & 1 deletion storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ func (s *storageImageDestination) commitLayer(index int, info addedLayerInfo, si
}
id := diffIDOrTOCDigest.Hex()
if parentLayer != "" {
id = digest.Canonical.FromBytes([]byte(parentLayer + "+" + diffIDOrTOCDigest.Hex())).Hex()
id = digest.Canonical.FromString(parentLayer + "+" + diffIDOrTOCDigest.Hex()).Hex()
}
if layer, err2 := s.imageRef.transport.store.Layer(id); layer != nil && err2 == nil {
// There's already a layer that should have the right contents, just reuse it.
Expand Down

0 comments on commit e0e8045

Please sign in to comment.