Skip to content

Commit aae2d0d

Browse files
eraindmcgowan
authored andcommitted
delete unnecessary checks and fix a test
Signed-off-by: Yu Yi <yiyu@google.com>
1 parent 9e183f5 commit aae2d0d

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

client_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,6 @@ func TestImagePullSomePlatforms(t *testing.T) {
287287
count := 0
288288
for _, manifest := range manifests {
289289
children, err := images.Children(ctx, cs, manifest)
290-
if err != nil {
291-
t.Fatal(err)
292-
}
293290

294291
found := false
295292
for _, matcher := range m {
@@ -315,6 +312,8 @@ func TestImagePullSomePlatforms(t *testing.T) {
315312
}
316313
ra.Close()
317314
}
315+
} else if err == nil {
316+
t.Fatal("manifest should not have pulled children content")
318317
}
319318
}
320319

cmd/ctr/commands/content/fetch.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ func NewFetchConfig(ctx context.Context, clicontext *cli.Context) (*FetchConfig,
123123
}
124124
config.Platforms = p
125125
}
126-
if clicontext.Bool("all-manifests") {
127-
config.IsAllManifests = clicontext.Bool("all-manifests")
128-
}
126+
127+
config.IsAllManifests = clicontext.Bool("all-manifests")
128+
129129
return config, nil
130130
}
131131

cmd/ctr/commands/images/pull.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ command. As part of this process, we do the following:
8282
if err != nil {
8383
return err
8484
}
85-
if context.Bool("all-manifests") {
86-
config.IsAllManifests = context.Bool("all-manifests")
87-
}
8885

8986
img, err := content.Fetch(ctx, client, ref, config)
9087
if err != nil {

0 commit comments

Comments
 (0)