Disable sync periodically polling when pollInterval is not configured

Filtering out sync on demand images based on content configuration

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu
2021-10-25 15:05:03 +03:00
committed by Ramkumar Chinchani
parent c61c3836db
commit c86f44cc53
7 changed files with 258 additions and 29 deletions
+8 -1
View File
@@ -48,8 +48,15 @@ func (h *PostHandler) Handler(w http.ResponseWriter, r *http.Request) {
}
for _, regCfg := range h.Cfg.Registries {
// if content not provided, don't run periodically sync
if len(regCfg.Content) == 0 {
h.Log.Info().Msgf("no content found for %s, will not run periodically sync", regCfg.URL)
h.Log.Info().Msgf("sync config content not configured for %s, will not run periodically sync", regCfg.URL)
continue
}
// if pollInterval is not provided, don't run periodically sync
if regCfg.PollInterval == 0 {
h.Log.Warn().Msgf("sync config PollInterval not configured for %s, will not run periodically sync", regCfg.URL)
continue
}