Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import java.time.Instant

@RestController
@RequestMapping(["/dockerRegistry/images", "/titus/images"])
Expand All @@ -51,7 +52,21 @@ class DockerRegistryImageLookupController {
Keys.getTaggedImageKey(account, repository, "*")
).sort { a, b ->
if (credentials.sortTagsByDate) {
b.attributes.date.epochSecond <=> a.attributes.date.epochSecond
Instant dateA
if (a.attributes.date instanceof String) {
dateA = Instant.parse(a.attributes.date)
} else {
dateA = a.attributes.date
}

Instant dateB
if (b.attributes.date instanceof String) {
dateB = Instant.parse(b.attributes.date)
} else {
dateB = b.attributes.date
}

dateB.epochSecond <=> dateA.epochSecond
} else {
a.id <=> b.id
}
Expand Down