fix(master): review fixes for newer-tag suggestions (#11)
This commit is contained in:
@@ -249,17 +249,21 @@ func followsNoTag(svc model.Service) bool {
|
||||
// newerTag returns the tag of the service's newer-tag suggestion, or "" when
|
||||
// there is none or it no longer holds. The poller writes the suggestion once
|
||||
// per cycle, so after the service moved to another tag the stored value can
|
||||
// be stale until the next cycle; checking again here hides it meanwhile.
|
||||
// be stale until the next cycle; checking again here hides it meanwhile. A
|
||||
// suggestion from another repo than the service follows now is hidden too.
|
||||
func newerTag(s model.Service) string {
|
||||
if s.RemovedAt != nil || s.NewerRef == "" {
|
||||
return ""
|
||||
}
|
||||
tag := imageref.Parse(s.NewerRef).Tag
|
||||
followed := imageref.Parse(jobs.FollowedRef(s.ActualRef)).Tag
|
||||
if _, ok := tagver.Newer(followed, []string{tag}); !ok {
|
||||
newer := imageref.Parse(s.NewerRef)
|
||||
repo, followed := poller.Followed(s)
|
||||
if newer.Repo != repo {
|
||||
return ""
|
||||
}
|
||||
return tag
|
||||
if _, ok := tagver.Newer(followed, []string{newer.Tag}); !ok {
|
||||
return ""
|
||||
}
|
||||
return newer.Tag
|
||||
}
|
||||
|
||||
// versionRow is an image version as shown on the service page.
|
||||
|
||||
Reference in New Issue
Block a user