From ccd74277f7f64b894f926d2c57686420ac95af29 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 5 Jun 2023 11:01:20 +0200 Subject: [PATCH] types: report when a layer is partial Signed-off-by: Giuseppe Scrivano --- storage/storage_src.go | 7 ++++--- types/types.go | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/storage/storage_src.go b/storage/storage_src.go index 03c2fa28c6..f16ff8d9ac 100644 --- a/storage/storage_src.go +++ b/storage/storage_src.go @@ -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 diff --git a/types/types.go b/types/types.go index 33adb5f1df..aa4c147604 100644 --- a/types/types.go +++ b/types/types.go @@ -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. }