Skip to content

Commit 2788604

Browse files
committed
Update ctr image pull all platforms
Allows supporting fetching of all platforms while unpacking for a subset of platforms. Signed-off-by: Derek McGowan <[email protected]>
1 parent b168147 commit 2788604

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cmd/ctr/commands/images/pull.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,20 @@ command. As part of this process, we do the following:
106106
}
107107

108108
var sopts []image.StoreOpt
109+
p, err := platforms.ParseAll(context.StringSlice("platform"))
110+
if err != nil {
111+
return err
112+
}
113+
114+
// Set unpack configuration
115+
for _, platform := range p {
116+
sopts = append(sopts, image.WithUnpack(platform, context.String("snapshotter")))
117+
}
109118
if !context.Bool("all-platforms") {
110-
p, err := platforms.ParseAll(context.StringSlice("platform"))
111-
if err != nil {
112-
return err
113-
}
114119
if len(p) == 0 {
115120
p = append(p, platforms.DefaultSpec())
116121
}
117122
sopts = append(sopts, image.WithPlatforms(p...))
118-
119-
// Set unpack configuration
120-
for _, platform := range p {
121-
sopts = append(sopts, image.WithUnpack(platform, context.String("snapshotter")))
122-
}
123123
}
124124
// TODO: Support unpack for all platforms..?
125125
// Pass in a *?

0 commit comments

Comments
 (0)