Show artifact digest in list output

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
pull/2971/head
Stefan Prodan 3 years ago
parent 7dd736954b
commit 1b327e9d4e
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF

@ -57,12 +57,17 @@ func List(ctx context.Context, url string) ([]Metadata, error) {
return nil, fmt.Errorf("parsing manifest failed: %w", err)
}
meta.Digest = manifest.Config.Digest.String()
if m, err := MetadataFromAnnotations(manifest.Annotations); err == nil {
meta.Revision = m.Revision
meta.Source = m.Source
}
digest, err := crane.Digest(meta.URL, craneOptions(ctx)...)
if err != nil {
return nil, fmt.Errorf("fetching digest failed: %w", err)
}
meta.Digest = digest
metas = append(metas, meta)
}

Loading…
Cancel
Save