vendor: github.com/docker/docker e5c2b5e10d68 (master, v28.0.0-dev)

full diff: 6ac445c42b...e5c2b5e10d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-11-20 15:38:43 +01:00
parent 81401f37f2
commit d41b80fafc
23 changed files with 185 additions and 69 deletions

View File

@ -78,7 +78,8 @@ func runLoad(ctx context.Context, dockerCli command.Cli, opts loadOptions) error
if err != nil {
return errors.Wrap(err, "invalid platform")
}
options.Platform = &p
// TODO(thaJeztah): change flag-type to support multiple platforms.
options.Platforms = append(options.Platforms, p)
}
response, err := dockerCli.Client().ImageLoad(ctx, input, options)

View File

@ -109,7 +109,7 @@ func TestNewLoadCommandSuccess(t *testing.T) {
name: "with platform",
args: []string{"--platform", "linux/amd64"},
imageLoadFunc: func(input io.Reader, options image.LoadOptions) (image.LoadResponse, error) {
assert.Check(t, is.DeepEqual(ocispec.Platform{OS: "linux", Architecture: "amd64"}, *options.Platform))
assert.Check(t, is.DeepEqual([]ocispec.Platform{{OS: "linux", Architecture: "amd64"}}, options.Platforms))
return image.LoadResponse{Body: io.NopCloser(strings.NewReader("Success"))}, nil
},
},

View File

@ -63,7 +63,8 @@ func RunSave(ctx context.Context, dockerCli command.Cli, opts saveOptions) error
if err != nil {
return errors.Wrap(err, "invalid platform")
}
options.Platform = &p
// TODO(thaJeztah): change flag-type to support multiple platforms.
options.Platforms = append(options.Platforms, p)
}
responseBody, err := dockerCli.Client().ImageSave(ctx, opts.images, options)

View File

@ -106,7 +106,7 @@ func TestNewSaveCommandSuccess(t *testing.T) {
imageSaveFunc: func(images []string, options image.SaveOptions) (io.ReadCloser, error) {
assert.Assert(t, is.Len(images, 1))
assert.Check(t, is.Equal("arg1", images[0]))
assert.Check(t, is.DeepEqual(ocispec.Platform{OS: "linux", Architecture: "amd64"}, *options.Platform))
assert.Check(t, is.DeepEqual([]ocispec.Platform{{OS: "linux", Architecture: "amd64"}}, options.Platforms))
return io.NopCloser(strings.NewReader("")), nil
},
},