Add option to pull all metadata

Add flags to pull and fetch to grab all metadata.
Add fetch option to pull only metadata.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2019-08-23 15:48:05 -07:00
parent aae2d0d754
commit a40c3830df
6 changed files with 43 additions and 34 deletions

View File

@@ -99,9 +99,7 @@ func TestImagePullWithDistSourceLabel(t *testing.T) {
pMatcher := platforms.Default()
// pull content without unpack and add distribution source label
image, err := client.Pull(ctx, imageName,
WithPlatformMatcher(pMatcher),
WithAppendDistributionSourceLabel())
image, err := client.Pull(ctx, imageName, WithPlatformMatcher(pMatcher))
if err != nil {
t.Fatal(err)
}
@@ -183,7 +181,7 @@ func TestImageUsage(t *testing.T) {
imageName = imageName + "@" + image.Target().Digest.String()
// Fetch single platforms, but all manifests pulled
if _, err := client.Fetch(ctx, imageName, WithPlatformMatcher(testPlatform)); err != nil {
if _, err := client.Fetch(ctx, imageName, WithPlatformMatcher(testPlatform), WithAllMetadata()); err != nil {
t.Fatal(err)
}