Skip to content

Commit

Permalink
copy: add layer annotations to TryReusingBlobOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 6, 2023
1 parent bd7ee9b commit 82b559c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions copy/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
EmptyLayer: emptyLayer,
LayerIndex: &layerIndex,
SrcRef: srcRef,
Annotations: srcInfo.Annotations,
})
if err != nil {
return types.BlobInfo{}, "", fmt.Errorf("trying to reuse blob %s at destination: %w", srcInfo.Digest, err)
Expand Down
7 changes: 4 additions & 3 deletions internal/private/private.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ type TryReusingBlobOptions struct {
// if they use internal/imagedestination/impl.Compat;
// in that case, they will all be consistently zero-valued.

EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
LayerIndex *int // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
SrcRef reference.Named // A reference to the source image that contains the input blob.
EmptyLayer bool // True if the blob is an "empty"/"throwaway" layer, and may not necessarily be physically represented.
LayerIndex *int // If the blob is a layer, a zero-based index of the layer within the image; nil otherwise.
SrcRef reference.Named // A reference to the source image that contains the input blob.
Annotations map[string]string // Annotations specified for the layer.
}

// ReusedBlob is information about a blob reused in a destination.
Expand Down

0 comments on commit 82b559c

Please sign in to comment.