diff --git a/client_test.go b/client_test.go index 97776baaa..182e5ca75 100644 --- a/client_test.go +++ b/client_test.go @@ -287,9 +287,6 @@ func TestImagePullSomePlatforms(t *testing.T) { count := 0 for _, manifest := range manifests { children, err := images.Children(ctx, cs, manifest) - if err != nil { - t.Fatal(err) - } found := false for _, matcher := range m { @@ -315,6 +312,8 @@ func TestImagePullSomePlatforms(t *testing.T) { } ra.Close() } + } else if err == nil { + t.Fatal("manifest should not have pulled children content") } } diff --git a/cmd/ctr/commands/content/fetch.go b/cmd/ctr/commands/content/fetch.go index 0f9f36799..ea4c840ab 100644 --- a/cmd/ctr/commands/content/fetch.go +++ b/cmd/ctr/commands/content/fetch.go @@ -123,9 +123,9 @@ func NewFetchConfig(ctx context.Context, clicontext *cli.Context) (*FetchConfig, } config.Platforms = p } - if clicontext.Bool("all-manifests") { - config.IsAllManifests = clicontext.Bool("all-manifests") - } + + config.IsAllManifests = clicontext.Bool("all-manifests") + return config, nil } diff --git a/cmd/ctr/commands/images/pull.go b/cmd/ctr/commands/images/pull.go index d7df2851f..566b62f38 100644 --- a/cmd/ctr/commands/images/pull.go +++ b/cmd/ctr/commands/images/pull.go @@ -82,9 +82,6 @@ command. As part of this process, we do the following: if err != nil { return err } - if context.Bool("all-manifests") { - config.IsAllManifests = context.Bool("all-manifests") - } img, err := content.Fetch(ctx, client, ref, config) if err != nil {