Skip to content

Commit 437a464

Browse files
authored
Fix pulling signed images (#431)
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 e81651e commit 437a464

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/source/containers_image.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ func (i *ContainersImageRegistry) Unpack(ctx context.Context, catalog *catalogdv
131131
//////////////////////////////////////////////////////
132132
if _, err := copy.Image(ctx, policyContext, layoutRef, dockerRef, &copy.Options{
133133
SourceCtx: srcCtx,
134+
// We use the OCI layout as a temporary storage and
135+
// pushing signatures for OCI images is not supported
136+
// so we remove the source signatures when copying.
137+
// Signature validation will still be performed
138+
// accordingly to a provided policy context.
139+
RemoveSignatures: true,
134140
}); err != nil {
135141
return nil, fmt.Errorf("error copying image: %w", err)
136142
}

0 commit comments

Comments
 (0)