2023-02-16 01:20:28 -05:00
|
|
|
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
|
2023-11-28 15:08:15 -05:00
|
|
|
/* 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
|
2023-02-16 01:20:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type RegistryConfig struct {
|
|
|
|
URLs []string
|
|
|
|
PollInterval time.Duration
|
|
|
|
Content []Content
|
|
|
|
TLSVerify *bool
|
|
|
|
OnDemand bool
|
|
|
|
CertDir string
|
|
|
|
MaxRetries *int
|
|
|
|
RetryDelay *time.Duration
|
|
|
|
OnlySigned *bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type Content struct {
|
|
|
|
Prefix string
|
|
|
|
Tags *Tags
|
|
|
|
Destination string `mapstructure:",omitempty"`
|
|
|
|
StripPrefix bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type Tags struct {
|
|
|
|
Regex *string
|
|
|
|
Semver *bool
|
|
|
|
}
|