image

package
v1.12.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PullTimeout       = 20 * time.Minute
	PullRetryInterval = 5 * time.Second
)

Image pull retry settings.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(reg cri.Registries) remotes.Resolver

NewResolver builds registry resolver based on Talos configuration.

func PrepareAuth

func PrepareAuth(auth config.RegistryAuthConfig, host, expectedHost string) (string, string, error)

PrepareAuth returns authentication info in the format expected by containerd.

func Pull

func Pull(ctx context.Context, registryBuilder RegistriesBuilder, client *containerd.Client, ref string, opt ...PullOption) (img containerd.Image, err error)

Pull is a convenience function that wraps the containerd image pull func with retry functionality.

func RegistryHosts

func RegistryHosts(reg cri.Registries) docker.RegistryHosts

RegistryHosts returns host configuration per registry.

Types

type EndpointEntry added in v1.9.0

type EndpointEntry struct {
	Endpoint     string
	OverridePath bool
}

EndpointEntry represents a registry endpoint.

func RegistryEndpointEntriesFromConfig added in v1.9.0

func RegistryEndpointEntriesFromConfig(host string, reg config.RegistryMirrorConfig) ([]EndpointEntry, error)

RegistryEndpointEntriesFromConfig returns registry endpoints per host.

func RegistryEndpoints

func RegistryEndpoints(reg cri.Registries, host string) (endpoints []EndpointEntry, err error)

RegistryEndpoints returns registry endpoints per host using reg.

type PullOption

type PullOption func(*PullOptions)

PullOption is an option for Pull function.

func WithMaxNotFoundRetries added in v1.10.5

func WithMaxNotFoundRetries(maxRetries int) PullOption

WithMaxNotFoundRetries sets the maximum number of retries for not found errors.

func WithSkipIfAlreadyPulled

func WithSkipIfAlreadyPulled() PullOption

WithSkipIfAlreadyPulled skips pulling if image is already pulled and unpacked.

type PullOptions

type PullOptions struct {
	SkipIfAlreadyPulled bool
	MaxNotFoundRetries  int
}

PullOptions configure Pull function.

func DefaultPullOptions added in v1.10.5

func DefaultPullOptions() PullOptions

DefaultPullOptions returns default options for Pull function.

type RegistriesBuilder added in v1.9.0

type RegistriesBuilder = func(context.Context) (cri.Registries, error)

RegistriesBuilder is a function that returns registries configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL