mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
feat(sync): add tag excludeRegex filter (#2906)
Fix #2902 Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
This commit is contained in:
@@ -1148,6 +1148,16 @@ func validateSync(config *config.Config, log zlog.Logger) error {
|
||||
}
|
||||
}
|
||||
|
||||
if content.Tags != nil && content.Tags.ExcludeRegex != nil {
|
||||
_, err := regexp.Compile(*content.Tags.ExcludeRegex)
|
||||
if err != nil {
|
||||
msg := "sync content excludeRegex could not be compiled"
|
||||
log.Error().Err(glob.ErrBadPattern).Str("excludeRegex", *content.Tags.ExcludeRegex).Msg(msg)
|
||||
|
||||
return fmt.Errorf("%w: %s: %s", zerr.ErrBadConfig, msg, *content.Tags.ExcludeRegex)
|
||||
}
|
||||
}
|
||||
|
||||
if content.StripPrefix && !strings.Contains(content.Prefix, "/*") && content.Destination == "/" {
|
||||
msg := "can not use stripPrefix true and destination '/' without using glob patterns in prefix"
|
||||
log.Error().Err(zerr.ErrBadConfig).
|
||||
|
||||
Reference in New Issue
Block a user