Skip to content

Commit

Permalink
More version comparison logging
Browse files Browse the repository at this point in the history
  • Loading branch information
plumdog committed Oct 9, 2018
1 parent f571b82 commit 98f4ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trigger/poll/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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")
}
}
2 changes: 2 additions & 0 deletions util/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 98f4ff3

Please sign in to comment.