Documentation
¶
Index ¶
- Constants
- func NewResolver(reg workload.Registries) remotes.Resolver
- func PrepareAuth(auth config.RegistryAuthConfig, host, expectedHost string) (string, string, error)
- func Pull(ctx context.Context, registryBuilder RegistriesBuilder, ...) (img containerd.Image, err error)
- func RegistryHosts(reg workload.Registries) docker.RegistryHosts
- type EndpointEntry
- type NewProgressReporter
- type ProgressReporter
- type PullOption
- type PullOptions
- type RegistriesBuilder
Constants ¶
const ( PullTimeout = 20 * time.Minute PullRetryInterval = 5 * time.Second )
Image pull retry settings.
Variables ¶
This section is empty.
Functions ¶
func NewResolver ¶
func NewResolver(reg workload.Registries) remotes.Resolver
NewResolver builds registry resolver based on Chubo configuration.
func PrepareAuth ¶
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 workload.Registries) docker.RegistryHosts
RegistryHosts returns host configuration per registry.
Types ¶
type EndpointEntry ¶
EndpointEntry represents a registry endpoint.
func RegistryEndpointEntriesFromConfig ¶
func RegistryEndpointEntriesFromConfig(host string, reg config.RegistryMirrorConfig) ([]EndpointEntry, error)
RegistryEndpointEntriesFromConfig returns registry endpoints per host.
func RegistryEndpoints ¶
func RegistryEndpoints(reg workload.Registries, host string) (endpoints []EndpointEntry, err error)
RegistryEndpoints returns registry endpoints per host using reg.
type NewProgressReporter ¶
type NewProgressReporter func(imageRef string) ProgressReporter
NewProgressReporter creates a new progress reporter.
func NewSimpleProgressReporter ¶
func NewSimpleProgressReporter(updateFn func(progress.LayerPullProgress)) NewProgressReporter
NewSimpleProgressReporter creates a simple progress reporter that just needs Update function.
type ProgressReporter ¶
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 ¶
func WithMaxNotFoundRetries(maxRetries int) PullOption
WithMaxNotFoundRetries sets the maximum number of retries for not found errors.
func WithProgressReporter ¶
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 ¶
func DefaultPullOptions() PullOptions
DefaultPullOptions returns default options for Pull function.
type RegistriesBuilder ¶
type RegistriesBuilder = func(context.Context) (workload.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. |