2021-06-08 15:11:18 -05:00
|
|
|
package config
|
2020-10-14 16:47:20 -05:00
|
|
|
|
2021-06-08 15:11:18 -05:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2021-12-03 22:50:58 -05:00
|
|
|
"zotregistry.io/zot/pkg/extensions/sync"
|
2021-06-08 15:11:18 -05:00
|
|
|
)
|
2020-10-14 16:47:20 -05:00
|
|
|
|
2022-10-21 07:33:54 -05:00
|
|
|
// BaseConfig has params applicable to all extensions.
|
|
|
|
type BaseConfig struct {
|
|
|
|
Enable *bool `mapstructure:",omitempty"`
|
|
|
|
}
|
|
|
|
|
2020-10-14 16:47:20 -05:00
|
|
|
type ExtensionConfig struct {
|
2021-10-15 10:05:00 -05:00
|
|
|
Search *SearchConfig
|
|
|
|
Sync *sync.Config
|
|
|
|
Metrics *MetricsConfig
|
2022-03-04 02:37:06 -05:00
|
|
|
Scrub *ScrubConfig
|
2022-06-24 08:08:47 -05:00
|
|
|
Lint *LintConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
type LintConfig struct {
|
2022-10-21 07:33:54 -05:00
|
|
|
BaseConfig `mapstructure:",squash"`
|
2022-06-24 08:08:47 -05:00
|
|
|
MandatoryAnnotations []string
|
2020-10-14 16:47:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type SearchConfig struct {
|
2022-10-21 07:33:54 -05:00
|
|
|
BaseConfig `mapstructure:",squash"`
|
2020-10-14 16:47:20 -05:00
|
|
|
// CVE search
|
2022-10-21 07:33:54 -05:00
|
|
|
CVE *CVEConfig
|
2020-10-14 16:47:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
type CVEConfig struct {
|
|
|
|
UpdateInterval time.Duration // should be 2 hours or more, if not specified default be kept as 24 hours
|
|
|
|
}
|
2021-10-15 10:05:00 -05:00
|
|
|
|
|
|
|
type MetricsConfig struct {
|
2022-10-21 07:33:54 -05:00
|
|
|
BaseConfig `mapstructure:",squash"`
|
2021-10-15 10:05:00 -05:00
|
|
|
Prometheus *PrometheusConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
type PrometheusConfig struct {
|
|
|
|
Path string // default is "/metrics"
|
|
|
|
}
|
2022-03-04 02:37:06 -05:00
|
|
|
|
|
|
|
type ScrubConfig struct {
|
2022-10-21 07:33:54 -05:00
|
|
|
BaseConfig `mapstructure:",squash"`
|
|
|
|
Interval time.Duration
|
2022-03-04 02:37:06 -05:00
|
|
|
}
|