From 975803a6a714d7fbff151d514aa30ae8a39da73a Mon Sep 17 00:00:00 2001 From: Roman Vynar Date: Thu, 1 Sep 2022 18:16:48 +0300 Subject: [PATCH] Add comment --- registry/tasks.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/registry/tasks.go b/registry/tasks.go index 5c2f644..574cec3 100644 --- a/registry/tasks.go +++ b/registry/tasks.go @@ -36,11 +36,12 @@ func (p timeSlice) Len() int { } func (p timeSlice) Less(i, j int) bool { + // reverse sort tags on name if equal dates (OCI image case) + // see https://github.com/Quiq/docker-registry-ui/pull/62 if p[i].created.Equal(p[j].created) { return p[i].name > p[j].name - } else { - return p[i].created.After(p[j].created) } + return p[i].created.After(p[j].created) } func (p timeSlice) Swap(i, j int) { @@ -86,10 +87,10 @@ func PurgeOldTags(client *Client, config *PurgeTagsConfig) { } tags := client.Tags(repo) - logger.Infof("[%s] scanning %d tags...", repo, len(tags)) if len(tags) == 0 { continue } + logger.Infof("[%s] scanning %d tags...", repo, len(tags)) for _, tag := range tags { _, infoV1, _ := client.TagInfo(repo, tag, true) if infoV1 == "" {