mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
fix(sync): revert code which removed image destination feature (#840)
Added an end to end test for this feature, closes #793 Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
+9
-1
@@ -598,10 +598,18 @@ func validateSync(config *config.Config) error {
|
||||
for _, content := range regCfg.Content {
|
||||
ok := glob.ValidatePattern(content.Prefix)
|
||||
if !ok {
|
||||
log.Error().Err(glob.ErrBadPattern).Str("pattern", content.Prefix).Msg("sync pattern could not be compiled")
|
||||
log.Error().Err(glob.ErrBadPattern).Str("prefix", content.Prefix).Msg("sync prefix could not be compiled")
|
||||
|
||||
return glob.ErrBadPattern
|
||||
}
|
||||
|
||||
if content.StripPrefix && !strings.Contains(content.Prefix, "/*") && content.Destination == "/" {
|
||||
log.Error().Err(errors.ErrBadConfig).
|
||||
Interface("sync content", content).
|
||||
Msg("sync config: can not use stripPrefix true and destination '/' without using glob patterns in prefix")
|
||||
|
||||
return errors.ErrBadConfig
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user