From 90b53747e996c2bbb174fed81feb84ce6fc44a53 Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Thu, 3 Oct 2024 16:43:44 -0400 Subject: [PATCH] copy: Allow copying images with signatures This error path was taken even when the destination supports signatures. The call to `sourceSignatures()` will return an error when the destination does not support signatures, so an error should not be thrown when len(sigs) > 0. Signed-off-by: Chris Kyrouac --- copy/multiple.go | 3 --- copy/single.go | 3 --- 2 files changed, 6 deletions(-) diff --git a/copy/multiple.go b/copy/multiple.go index 009a067ce..5a6e38e41 100644 --- a/copy/multiple.go +++ b/copy/multiple.go @@ -197,9 +197,6 @@ func (c *copier) copyMultipleImages(ctx context.Context) (copiedManifest []byte, // If we can, set to the empty string. If we can't, set to the reason why. // Compare, and perhaps keep in sync with, the version in copySingleImage. cannotModifyManifestListReason := "" - if len(sigs) > 0 { - cannotModifyManifestListReason = "Would invalidate signatures" - } if destIsDigestedReference { cannotModifyManifestListReason = "Destination specifies a digest" } diff --git a/copy/single.go b/copy/single.go index 324785a8b..bcfb87be3 100644 --- a/copy/single.go +++ b/copy/single.go @@ -124,9 +124,6 @@ func (c *copier) copySingleImage(ctx context.Context, unparsedImage *image.Unpar // If we can, set to the empty string. If we can't, set to the reason why. // Compare, and perhaps keep in sync with, the version in copyMultipleImages. cannotModifyManifestReason := "" - if len(sigs) > 0 { - cannotModifyManifestReason = "Would invalidate signatures" - } if destIsDigestedReference { cannotModifyManifestReason = "Destination specifies a digest" }