Skip to content

Commit fe84c5f

Browse files
authored
Fix pulling signed images (#1369)
This fixes "pushing signatures for OCI images is not supported" error when working with signed source images. If policy context requires signature validation for a registry we will still be performing it on pull, but we will be removing source signatures when copying into a temporary OCI layout for unpacking. Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 78b586a commit fe84c5f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/rukpak/source/containers_image.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ func (i *ContainersImageRegistry) Unpack(ctx context.Context, bundle *BundleSour
123123
//////////////////////////////////////////////////////
124124
if _, err := copy.Image(ctx, policyContext, layoutRef, dockerRef, &copy.Options{
125125
SourceCtx: srcCtx,
126+
// We use the OCI layout as a temporary storage and
127+
// pushing signatures for OCI images is not supported
128+
// so we remove the source signatures when copying.
129+
// Signature validation will still be performed
130+
// accordingly to a provided policy context.
131+
RemoveSignatures: true,
126132
}); err != nil {
127133
return nil, fmt.Errorf("error copying image: %w", err)
128134
}

0 commit comments

Comments
 (0)