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 5a41f61 commit 386c41d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func (s *storageImageDestination) tryReusingBlobAsPending(blobDigest digest.Dige

// Check if we've already cached it in a file.
if size, ok := s.lockProtected.fileSizes[blobDigest]; ok {
// FIXME: What ensures layer identification?
return true, private.ReusedBlob{
Digest: blobDigest,
Size: size,
Expand Down Expand Up @@ -451,12 +452,13 @@ 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)
}
if len(layers) > 0 {
// FIXME: createNewLayer currently requires diffID to be set if .diffOutput is not set
s.lockProtected.indexToTOCDigest[*options.LayerIndex] = options.TOCDigest
return true, private.ReusedBlob{
Digest: blobDigest,
Expand Down Expand Up @@ -625,7 +627,7 @@ func (s *storageImageDestination) singleLayerIDComponent(layerIndex int, blobDig
defer s.lock.Unlock()

if d, found := s.lockProtected.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.lockProtected.blobDiffIDs[blobDigest]
Expand Down

0 comments on commit 386c41d

Please sign in to comment.