image

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MPL-2.0 Imports: 37 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 NewTagFetcher added in v1.13.3

func NewTagFetcher(reg cri.Registries) verify.TagFetcher

NewTagFetcher builds a verify.TagFetcher that fetches a manifest by its tag URL through the same RegistryHosts (auth + TLS + mirror list) used by the resolver.

It is the fallback used by signature verification when the resolver's digest-based manifest fetch returns NotFound, e.g. against registry.k8s.io's CDN where the HEAD-by-tag and GET-by-digest requests can be routed to different regional backends with inconsistent replication.

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,
	resources state.State,
	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 NewProgressReporter added in v1.13.0

type NewProgressReporter func(imageRef string) ProgressReporter

NewProgressReporter creates a new progress reporter.

func NewSimpleProgressReporter added in v1.13.0

func NewSimpleProgressReporter(updateFn func(progress.LayerPullProgress)) NewProgressReporter

NewSimpleProgressReporter creates a simple progress reporter that just needs Update function.

type ProgressReporter added in v1.13.0

type ProgressReporter interface {
	Start()
	Stop()
	Update(progress.LayerPullProgress)
}

ProgressReporter is an interface for reporting image pull progress.

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 WithProgressReporter added in v1.13.0

func WithProgressReporter(newReporter NewProgressReporter) PullOption

WithProgressReporter enables reporting pull progress.

func WithSkipIfAlreadyPulled

func WithSkipIfAlreadyPulled() PullOption

WithSkipIfAlreadyPulled skips pulling if image is already pulled and unpacked.

type PullOptions

type PullOptions struct {
	SkipIfAlreadyPulled bool
	MaxNotFoundRetries  int
	NewProgressReporter NewProgressReporter
}

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.

Directories

Path Synopsis
Package console provides a console-based implementation of image pull progress reporting.
Package console provides a console-based implementation of image pull progress reporting.
Package progress provides functionality to track and report image pull progress.
Package progress provides functionality to track and report image pull progress.
Package verify provides functionality to verify container images against configured verification policies.
Package verify provides functionality to verify container images against configured verification policies.
internal/cosign
Package cosign provides cosign-based image signature verification via Talos pull process.
Package cosign provides cosign-based image signature verification via Talos pull process.

Jump to

Keyboard shortcuts

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