Skip to content

Commit

Permalink
FIXMEs
Browse files Browse the repository at this point in the history
Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Feb 9, 2024
1 parent 1911e93 commit 296516c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func (s *storageImageDestination) tryReusingBlobAsPending(blobDigest digest.Dige

// Check if we've already cached it in a file.
if size, ok := s.fileSizes[blobDigest]; ok {
// FIXME: What ensures layer identification?
return true, private.ReusedBlob{
Digest: blobDigest,
Size: size,
Expand Down Expand Up @@ -448,7 +449,7 @@ func (s *storageImageDestination) tryReusingBlobAsPending(blobDigest digest.Dige

if options.TOCDigest != "" && options.LayerIndex != nil {
// Check if we have a chunked layer in storage with the same TOC digest.
layers, err := s.imageRef.transport.store.LayersByTOCDigest(options.TOCDigest)
layers, err := s.imageRef.transport.store.LayersByTOCDigest(options.TOCDigest) // FIXME: We can’t find this layer later!

if err != nil && !errors.Is(err, storage.ErrLayerUnknown) {
return false, private.ReusedBlob{}, fmt.Errorf(`looking for layers with TOC digest %q: %w`, options.TOCDigest, err)
Expand Down Expand Up @@ -620,7 +621,7 @@ func (s *storageImageDestination) singleLayerIDComponent(layerIndex int, blobSum
defer s.lock.Unlock()

if d, found := s.indexToTOCDigest[layerIndex]; found {
return d.Hex() + "-toc", found
return d.Hex() + "-toc", found // FIXME: If this is the first layer, this is not a valid ID.
}

d, found := s.blobDiffIDs[blobSum]
Expand Down

0 comments on commit 296516c

Please sign in to comment.