mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: support multiple platforms on save and load
We don't yet support this at the API level, so for now it returns an error when trying to set multiple, but this makes sure that the client types are already ready for this. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -15,16 +15,15 @@ func (cli *Client) ImageSave(ctx context.Context, imageIDs []string, opts image.
|
||||
"names": imageIDs,
|
||||
}
|
||||
|
||||
if opts.Platform != nil {
|
||||
if len(opts.Platforms) > 0 {
|
||||
if err := cli.NewVersionError(ctx, "1.48", "platform"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p, err := encodePlatform(opts.Platform)
|
||||
p, err := encodePlatforms(opts.Platforms...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
query.Set("platform", p)
|
||||
query["platform"] = p
|
||||
}
|
||||
|
||||
resp, err := cli.get(ctx, "/images/get", query, nil)
|
||||
|
||||
Reference in New Issue
Block a user