diff --git a/storage/storage_dest.go b/storage/storage_dest.go index 5f54459e9f..b1a8341fd8 100644 --- a/storage/storage_dest.go +++ b/storage/storage_dest.go @@ -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, @@ -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, @@ -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]