image

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

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

Image pull retry settings.

View Source
const (
	ImportTimeout       = 5 * time.Minute
	ImportRetryInterval = 5 * time.Second
	ImportRetryJitter   = time.Second
)

Image import retry settings.

Variables

This section is empty.

Functions

func Import

func Import(ctx context.Context, imagePath, indexName string) error

Import is a convenience function that wraps containerd image import with retries.

func NewResolver

func NewResolver(reg config.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, reg config.Registries, 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 RegistryEndpoints

func RegistryEndpoints(reg config.Registries, host string) (endpoints []string, overridePath bool, err error)

RegistryEndpoints returns registry endpoints per host using reg.

func RegistryHosts

func RegistryHosts(reg config.Registries) docker.RegistryHosts

RegistryHosts returns host configuration per registry.

Types

type PullOption

type PullOption func(*PullOptions)

PullOption is an option for Pull function.

func WithSkipIfAlreadyPulled

func WithSkipIfAlreadyPulled() PullOption

WithSkipIfAlreadyPulled skips pulling if image is already pulled and unpacked.

type PullOptions

type PullOptions struct {
	SkipIfAlreadyPulled bool
}

PullOptions configure Pull function.

Jump to

Keyboard shortcuts

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