6aab0a6175
Currently, if an image was copied with: $ skopeo copy \ containers-storage:registry.fedoraproject.org/fedora-toolbox:36 \ containers-storage:localhost/fedora-toolbox:36 ... or: $ podman tag \ registry.fedoraproject.org/fedora-toolbox:36 \ localhost/fedora-toolbox:36 ... then it would show up twice in 'list' with the same name, and in the wrong order. Either as: $ toolbox list --images IMAGE ID IMAGE NAME CREATED 2110dbbc33d2 localhost/fedora-toolbox:36 1 day... e085805ade4a registry.access.redhat.com/ubi8/toolbox:latest 1 day... 2110dbbc33d2 localhost/fedora-toolbox:36 1 day... 70cbe2ce60ca registry.fedoraproject.org/fedora-toolbox:34 1 day... ... or as: $ toolbox list --images IMAGE ID IMAGE NAME CREATED 2110dbbc33d2 registry.fedoraproject.org/fedora-toolbox:36 1 day... e085805ade4a registry.access.redhat.com/ubi8/toolbox:latest 1 day... 2110dbbc33d2 registry.fedoraproject.org/fedora-toolbox:36 1 day... 70cbe2ce60ca registry.fedoraproject.org/fedora-toolbox:34 1 day... The correct output should be similar to 'podman images', and be sorted in ascending order of the names: $ toolbox list --images IMAGE ID IMAGE NAME CREATED 2110dbbc33d2 localhost/fedora-toolbox:36 1 day... e085805ade4a registry.access.redhat.com/ubi8/toolbox:latest 1 day... 70cbe2ce60ca registry.fedoraproject.org/fedora-toolbox:34 1 day... 2110dbbc33d2 registry.fedoraproject.org/fedora-toolbox:36 1 day... The problem is that, in these situations, 'podman images --format json' returns separate identical JSON collections for each copy of the image, and all of those copies have multiple names: [ { "Id": "2110dbbc33d2", ... "Names": [ "localhost/fedora-toolbox:36", "registry.fedoraproject.org/fedora-toolbox:36" ], ... }, { "Id": "e085805ade4a", ... "Names": [ "registry.access.redhat.com/ubi8/toolbox:latest" ], ... }, { "Id": "2110dbbc33d2", ... "Names": [ "localhost/fedora-toolbox:36", "registry.fedoraproject.org/fedora-toolbox:36" ], ... } { "Id": "70cbe2ce60ca", ... "Names": [ "registry.fedoraproject.org/fedora-toolbox:34" ], ... }, ] The image objects need to be flattened to have only one unique name per copy, but with the same ID, and then sorted to ensure the right order. Note that the ordering was already broken since commit |
||
---|---|---|
.. | ||
system |