6e37b622d3
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> |
||
---|---|---|
.. | ||
store.go | ||
store_test.go |