mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-25 06:49:28 +01:00
Add option to set the maximum number of tags to watch for an item if watch_repo is enabled
This commit is contained in:
@@ -102,6 +102,17 @@ func (cfg *Config) Check() error {
|
||||
}
|
||||
|
||||
for key, item := range cfg.Items {
|
||||
if item.Image == "" {
|
||||
return fmt.Errorf("image is required for item %d", key)
|
||||
}
|
||||
|
||||
if err := mergo.Merge(&item, model.Item{
|
||||
WatchRepo: false,
|
||||
MaxTags: 25,
|
||||
}); err != nil {
|
||||
return fmt.Errorf("cannot set default item values for %s: %v", item.Image, err)
|
||||
}
|
||||
|
||||
if item.RegistryID != "" {
|
||||
reg, found := cfg.Registries[item.RegistryID]
|
||||
if !found {
|
||||
|
||||
Reference in New Issue
Block a user