Skip to content

Commit

Permalink
types: report when a layer is partial
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 5, 2023
1 parent 32e1469 commit ccd7427
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions storage/storage_src.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,10 @@ func (s *storageImageSource) LayerInfosForCopy(ctx context.Context, instanceDige
return nil, fmt.Errorf("uncompressed size for layer %q is unknown", layerID)
}
blobInfo := types.BlobInfo{
Digest: layer.UncompressedDigest,
Size: layer.UncompressedSize,
MediaType: uncompressedLayerType,
Digest: layer.UncompressedDigest,
Size: layer.UncompressedSize,
MediaType: uncompressedLayerType,
Incremental: layer.Incremental,
}
physicalBlobInfos = append([]types.BlobInfo{blobInfo}, physicalBlobInfos...)
layerID = layer.Parent
Expand Down
3 changes: 3 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ type BlobInfo struct {
// TODO: To remove together with CompressionOperation in re-design to
// remove field out of BlobInfo.
CryptoOperation LayerCrypto
// Incremental is used to indicate that the blob was created using a partial
// pull, so the uncompressed digest stored is not correct and must be validated.
Incremental bool
// Before adding any fields to this struct, read the NOTE above.
}

Expand Down

0 comments on commit ccd7427

Please sign in to comment.