registry/reference
Derek McGowan 1052518d9f
reference: implement Sort()
This upstreams `Sort()` as originally implemented in containerd in
https://github.com/containerd/containerd/0886ceaea2470edc7339dfc5ebe0e3257ae84d06

From that commit:

> Fix reference ordering in CRI image store
>
> Currently image references end up being stored in a
> random order due to the way maps are iterated through
> in Go. This leads to inconsistent identifiers being
> resolved when a single reference is needed to identify
> an image and the ordering of the references is used for
> the selection.
>
> Sort references in a consistent and ranked manner,
> from higher information formats to lower.
>
> Note: A `name + tag` reference is considered higher
> information than a `name + digest` reference since a
> registry may be used to resolve the digest from a
> `name + tag` reference.

Co-Authored-by: Derek McGowan <derek@mcg.dev>
Co-Authored-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-08 22:38:47 +01:00
..
fuzz.go format code with gofumpt 2022-11-03 22:48:20 +01:00
helpers.go Merge pull request #2143 from dmcgowan/reference-familiar-match 2017-01-13 18:32:33 -08:00
normalize.go reference: remove support for deprecated "shortid" refs 2022-11-06 20:23:30 +01:00
normalize_test.go reference: remove support for deprecated "shortid" refs 2022-11-06 20:23:30 +01:00
reference.go referene: fix formatting of "deprecated" comment. 2022-11-06 22:52:01 +01:00
reference_test.go registry: support ipv6 addresses 2022-06-27 09:54:37 +02:00
regexp.go reference: remove support for deprecated "shortid" refs 2022-11-06 20:23:30 +01:00
regexp_test.go reference: remove support for deprecated "shortid" refs 2022-11-06 20:23:30 +01:00
sort.go reference: implement Sort() 2022-11-08 22:38:47 +01:00
sort_test.go reference: implement Sort() 2022-11-08 22:38:47 +01:00