Add option to set the maximum number of tags to watch for an item if watch_repo is enabled

This commit is contained in:
CrazyMax
2019-06-08 19:42:19 +02:00
parent 7f87602672
commit 00ed9d24e2
6 changed files with 34 additions and 7 deletions

View File

@@ -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 {