Update ctr image pull all platforms
Allows supporting fetching of all platforms while unpacking for a subset of platforms. Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
parent
b168147ca8
commit
2788604e49
@ -106,20 +106,20 @@ command. As part of this process, we do the following:
|
|||||||
}
|
}
|
||||||
|
|
||||||
var sopts []image.StoreOpt
|
var sopts []image.StoreOpt
|
||||||
if !context.Bool("all-platforms") {
|
|
||||||
p, err := platforms.ParseAll(context.StringSlice("platform"))
|
p, err := platforms.ParseAll(context.StringSlice("platform"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(p) == 0 {
|
|
||||||
p = append(p, platforms.DefaultSpec())
|
|
||||||
}
|
|
||||||
sopts = append(sopts, image.WithPlatforms(p...))
|
|
||||||
|
|
||||||
// Set unpack configuration
|
// Set unpack configuration
|
||||||
for _, platform := range p {
|
for _, platform := range p {
|
||||||
sopts = append(sopts, image.WithUnpack(platform, context.String("snapshotter")))
|
sopts = append(sopts, image.WithUnpack(platform, context.String("snapshotter")))
|
||||||
}
|
}
|
||||||
|
if !context.Bool("all-platforms") {
|
||||||
|
if len(p) == 0 {
|
||||||
|
p = append(p, platforms.DefaultSpec())
|
||||||
|
}
|
||||||
|
sopts = append(sopts, image.WithPlatforms(p...))
|
||||||
}
|
}
|
||||||
// TODO: Support unpack for all platforms..?
|
// TODO: Support unpack for all platforms..?
|
||||||
// Pass in a *?
|
// Pass in a *?
|
||||||
|
Loading…
Reference in New Issue
Block a user