mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-07-17 15:51:27 +00:00
Add comment
This commit is contained in:
parent
b7c5c52fa2
commit
975803a6a7
@ -36,11 +36,12 @@ func (p timeSlice) Len() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p timeSlice) Less(i, j int) bool {
|
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) {
|
if p[i].created.Equal(p[j].created) {
|
||||||
return p[i].name > p[j].name
|
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) {
|
func (p timeSlice) Swap(i, j int) {
|
||||||
@ -86,10 +87,10 @@ func PurgeOldTags(client *Client, config *PurgeTagsConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tags := client.Tags(repo)
|
tags := client.Tags(repo)
|
||||||
logger.Infof("[%s] scanning %d tags...", repo, len(tags))
|
|
||||||
if len(tags) == 0 {
|
if len(tags) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
logger.Infof("[%s] scanning %d tags...", repo, len(tags))
|
||||||
for _, tag := range tags {
|
for _, tag := range tags {
|
||||||
_, infoV1, _ := client.TagInfo(repo, tag, true)
|
_, infoV1, _ := client.TagInfo(repo, tag, true)
|
||||||
if infoV1 == "" {
|
if infoV1 == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user