Files
zot/pkg/extensions/config/sync/config.go
T
Lars Francke 7fa53f5b0f Sync images with a background context (#3537)
feat: Sync images with a background context

This means syncs/pulls will not be cancelled anymore when the requesting client disconnects.

The timeout used can be configured per registry

Signed-off-by: Lars Francke <git@lars-francke.de>
2025-11-20 08:52:27 -08:00

52 lines
1.1 KiB
Go

package sync
import (
"time"
)
// key is registry address.
type CredentialsFile map[string]Credentials
type Credentials struct {
Username string
Password string
}
type Config struct {
Enable *bool
CredentialsFile string
/* DownloadDir is needed only in case of using cloud based storages
it uses regclient to first copy images into this dir (as oci layout)
and then move them into storage. */
DownloadDir string
Registries []RegistryConfig
}
type RegistryConfig struct {
URLs []string
PollInterval time.Duration
Content []Content
TLSVerify *bool
OnDemand bool
CertDir string
MaxRetries *int
RetryDelay *time.Duration
OnlySigned *bool
CredentialHelper string
PreserveDigest bool // sync without converting
SyncTimeout time.Duration // timeout for on-demand sync operations; if zero or unset, defaults to 3 hours
}
type Content struct {
Prefix string
Tags *Tags
Destination string `mapstructure:",omitempty"`
StripPrefix bool
}
type Tags struct {
Regex *string
ExcludeRegex *string
Semver *bool
}