diff --git a/internal/app/diun.go b/internal/app/diun.go index e6b5335d..28edb726 100644 --- a/internal/app/diun.go +++ b/internal/app/diun.go @@ -158,6 +158,7 @@ func (di *Diun) Run() { Int("added", entries.CountNew). Int("updated", entries.CountUpdate). Int("unchanged", entries.CountUnchange). + Int("skipped", entries.CountSkip). Int("failed", entries.CountError). Msg("Jobs completed") } diff --git a/internal/app/hc.go b/internal/app/hc.go index aba13a92..2ec6ac53 100644 --- a/internal/app/hc.go +++ b/internal/app/hc.go @@ -32,6 +32,7 @@ func (di *Diun) HealthchecksSuccess(entries *model.NotifEntries) { * {{ .CountNew }} new tag(s) found * {{ .CountUpdate }} tag(s) updated * {{ .CountUnchange }} tag(s) unchanged +* {{ .CountSkip }} tag(s) skipped * {{ .CountError }} tag(s) with error`)) if err := logsTpl.Execute(&logsBuf, entries); err != nil { log.Error().Err(err).Msgf("Cannot create logs for Healthchecks success event") diff --git a/internal/app/job.go b/internal/app/job.go index 3607f318..86cca3bd 100644 --- a/internal/app/job.go +++ b/internal/app/job.go @@ -161,10 +161,12 @@ func (di *Diun) runJob(job model.Job) (entry model.NotifEntry) { Logger() if !utl.IsIncluded(job.RegImage.Tag, job.Image.IncludeTags) { - sublog.Warn().Msg("Tag not included") + entry.Status = model.ImageStatusSkip + sublog.Debug().Msg("Tag not included") return } else if utl.IsExcluded(job.RegImage.Tag, job.Image.ExcludeTags) { - sublog.Warn().Msg("Tag excluded") + entry.Status = model.ImageStatusSkip + sublog.Debug().Msg("Tag excluded") return } diff --git a/internal/model/image.go b/internal/model/image.go index 15986d02..c410d506 100644 --- a/internal/model/image.go +++ b/internal/model/image.go @@ -24,6 +24,7 @@ const ( ImageStatusNew = ImageStatus("new") ImageStatusUpdate = ImageStatus("update") ImageStatusUnchange = ImageStatus("unchange") + ImageStatusSkip = ImageStatus("skip") ImageStatusError = ImageStatus("error") ) diff --git a/internal/model/notif.go b/internal/model/notif.go index 79bfc16a..e6c2e8b2 100644 --- a/internal/model/notif.go +++ b/internal/model/notif.go @@ -10,6 +10,7 @@ type NotifEntries struct { CountNew int CountUpdate int CountUnchange int + CountSkip int CountError int CountTotal int } @@ -61,6 +62,9 @@ func (s *NotifEntries) Add(entry NotifEntry) { case ImageStatusUnchange: s.CountUnchange++ s.CountTotal++ + case ImageStatusSkip: + s.CountSkip++ + s.CountTotal++ case ImageStatusError: s.CountError++ s.CountTotal++