Skip to content

Commit ef0ced7

Browse files
committed
Add the same comment as appendSignaturesFromSigstoreAttachments in GetSignaturesWithFormat
Remove unused `impl.NoSignatures` from `ociImageSource` structure Simplify `GetSignaturesWithFormat` by removing redundant nil check for `instanceDigest` Signed-off-by: Ayato Tokubi <[email protected]>
1 parent 9e9e553 commit ef0ced7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

image/oci/layout/oci_src.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func (e ImageNotFoundError) Error() string {
3939
type ociImageSource struct {
4040
impl.Compat
4141
impl.PropertyMethodsInitialize
42-
impl.NoSignatures
4342
impl.DoesNotAffectLayerInfosForCopy
4443
stubs.NoGetBlobAtInitialize
4544

@@ -238,9 +237,6 @@ func GetLocalBlobPath(ctx context.Context, src types.ImageSource, digest digest.
238237

239238
func (s *ociImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDigest *digest.Digest) ([]signature.Signature, error) {
240239
if instanceDigest == nil {
241-
if s.descriptor.Digest == "" {
242-
return nil, errors.New("unknown manifest digest, can't get signatures")
243-
}
244240
instanceDigest = &s.descriptor.Digest
245241
}
246242

@@ -255,6 +251,8 @@ func (s *ociImageSource) GetSignaturesWithFormat(ctx context.Context, instanceDi
255251

256252
signatures := make([]signature.Signature, 0, len(ociManifest.Layers))
257253
for _, layer := range ociManifest.Layers {
254+
// Note that this copies all kinds of attachments: attestations, and whatever else is there,
255+
// not just signatures. We leave the signature consumers to decide based on the MIME type.
258256
payload, err := s.ref.getOCIDescriptorContents(layer.Digest, iolimits.MaxSignatureBodySize, s.sharedBlobDir)
259257
if err != nil {
260258
return nil, err

0 commit comments

Comments
 (0)