1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/tag
Aaron Lehmann 6e37b622d3 Make order of items in "docker images" deterministic
The server-side portion of "docker images" sorts the images it returns
by creation timestamp so the list keeps a consistent order. However, it
does not sort the RepoTags and RepoDigests lists that each image carries
along with it. Since items in these lists are populated from a map,
their order will vary. If the user has a collection of tags which point
to overlapping IDs, for example tags that point to the same images on
different registries, the order will fluctuate between invocations of
"docker images". This can be disorienting with a long list of images.

Sort these references at the tag store level, so that the tag store's
References call always returns references in a lexically sorted order.
As well as giving the tag store more deterministic behavior, doing it at
this level simplifies the tag store unit tests.

Do the same for the ReferencesByName call. This will make push-all-tags
iterate over the tags in a consistent order.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-07 18:31:51 -08:00
..
store.go Make order of items in "docker images" deterministic 2015-12-07 18:31:51 -08:00
store_test.go Make order of items in "docker images" deterministic 2015-12-07 18:31:51 -08:00