client: Client.ImageLoad: move description of platform parameter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-27 17:00:11 +01:00
parent bb27db85fb
commit 1051c7f89e
4 changed files with 14 additions and 14 deletions

View File

@@ -7,13 +7,9 @@ import (
"net/url" "net/url"
) )
// ImageLoad loads an image in the docker host from the client host. // ImageLoad loads an image in the docker host from the client host. It's up
// It's up to the caller to close the [io.ReadCloser] in the // to the caller to close the [io.ReadCloser] in the [ImageLoadResult]
// [ImageLoadResult] returned by this function. // returned by this function.
//
// Platform is an optional parameter that specifies the platform to load from
// the provided multi-platform image. Passing a platform only has an effect
// if the input image is a multi-platform image.
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, loadOpts ...ImageLoadOption) (ImageLoadResult, error) { func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, loadOpts ...ImageLoadOption) (ImageLoadResult, error) {
var opts imageLoadOpts var opts imageLoadOpts
for _, opt := range loadOpts { for _, opt := range loadOpts {

View File

@@ -38,6 +38,10 @@ func ImageLoadWithQuiet(quiet bool) ImageLoadOption {
} }
// ImageLoadWithPlatforms sets the platforms to be loaded from the image. // ImageLoadWithPlatforms sets the platforms to be loaded from the image.
//
// Platform is an optional parameter that specifies the platform to load from
// the provided multi-platform image. Passing a platform only has an effect
// if the input image is a multi-platform image.
func ImageLoadWithPlatforms(platforms ...ocispec.Platform) ImageLoadOption { func ImageLoadWithPlatforms(platforms ...ocispec.Platform) ImageLoadOption {
return imageLoadOptionFunc(func(opt *imageLoadOpts) error { return imageLoadOptionFunc(func(opt *imageLoadOpts) error {
if opt.apiOptions.Platforms != nil { if opt.apiOptions.Platforms != nil {

View File

@@ -7,13 +7,9 @@ import (
"net/url" "net/url"
) )
// ImageLoad loads an image in the docker host from the client host. // ImageLoad loads an image in the docker host from the client host. It's up
// It's up to the caller to close the [io.ReadCloser] in the // to the caller to close the [io.ReadCloser] in the [ImageLoadResult]
// [ImageLoadResult] returned by this function. // returned by this function.
//
// Platform is an optional parameter that specifies the platform to load from
// the provided multi-platform image. Passing a platform only has an effect
// if the input image is a multi-platform image.
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, loadOpts ...ImageLoadOption) (ImageLoadResult, error) { func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, loadOpts ...ImageLoadOption) (ImageLoadResult, error) {
var opts imageLoadOpts var opts imageLoadOpts
for _, opt := range loadOpts { for _, opt := range loadOpts {

View File

@@ -38,6 +38,10 @@ func ImageLoadWithQuiet(quiet bool) ImageLoadOption {
} }
// ImageLoadWithPlatforms sets the platforms to be loaded from the image. // ImageLoadWithPlatforms sets the platforms to be loaded from the image.
//
// Platform is an optional parameter that specifies the platform to load from
// the provided multi-platform image. Passing a platform only has an effect
// if the input image is a multi-platform image.
func ImageLoadWithPlatforms(platforms ...ocispec.Platform) ImageLoadOption { func ImageLoadWithPlatforms(platforms ...ocispec.Platform) ImageLoadOption {
return imageLoadOptionFunc(func(opt *imageLoadOpts) error { return imageLoadOptionFunc(func(opt *imageLoadOpts) error {
if opt.apiOptions.Platforms != nil { if opt.apiOptions.Platforms != nil {