feat(sync): add tag excludeRegex filter (#2906)

Fix #2902

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
This commit is contained in:
Vladimir Ermakov
2025-01-26 19:29:02 +01:00
committed by GitHub
parent d0de12d2d3
commit 22864a95c8
5 changed files with 80 additions and 2 deletions
+10
View File
@@ -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).