Files
moby/client/image_pull_opts.go
Sebastiaan van Stijn 137adde33d client: prepare option-structs for multiple platforms
Some methods currently support a single platform only, but we may
be able to support multiple platforms.

This patch prepares the option-structs for multi-platform support,
but (for now) returning an error if multiple options are provided.

We need a similar check on the daemon-side, but still need to check
on the client, as older daemons will ignore multiple platforms, which
may be unexpected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:04:34 +01:00

26 lines
854 B
Go

package client
import (
"context"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)
// ImagePullOptions holds information to pull images.
type ImagePullOptions struct {
All bool
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
// PrivilegeFunc is a function that clients can supply to retry operations
// after getting an authorization error. This function returns the registry
// authentication header value in base64 encoded format, or an error if the
// privilege request fails.
//
// For details, refer to [github.com/moby/moby/api/types/registry.RequestAuthConfig].
PrivilegeFunc func(context.Context) (string, error)
// Platforms selects the platforms to pull. Multiple platforms can be
// specified if the image ia a multi-platform image.
Platforms []ocispec.Platform
}