Merge pull request #286 from plumdog/more_version_comparison_logging

More version comparison logging
feature/policy_from_annotations
Karolis Rusenas 2018-10-09 22:02:55 +01:00 committed by GitHub
commit 4e1b35679a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -407,9 +407,8 @@ func (j *WatchRepositoryTagsJob) Run() {
return
}
log.Debugf("new tag '%s' available", latestVersion)
if newAvailable {
log.Debugf("new tag '%s' available", latestVersion)
// updating current latest
j.details.latest = latestVersion
event := types.Event{
@ -424,5 +423,7 @@ func (j *WatchRepositoryTagsJob) Run() {
"new_tag": latestVersion,
}).Info("trigger.poll.WatchRepositoryTagsJob: submiting event to providers")
j.providers.Submit(event)
} else {
log.Debugf("no new tag available")
}
}

View File

@ -109,7 +109,9 @@ func NewAvailable(current string, tags []string) (newVersion string, newAvailabl
sort.Sort(sort.Reverse(semver.Collection(vs)))
if currentVersion.LessThan(vs[0]) {
log.WithFields(log.Fields{"currentVersion": currentVersion, "latestAvailable": vs[0]}).Debug("latest available is newer than current")
return vs[0].Original(), true, nil
}
log.WithFields(log.Fields{"currentVersion": currentVersion, "latestAvailable": vs[0]}).Debug("latest available is not newer than current")
return "", false, nil
}