Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for image sorting for all options #6674

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

jwhonce
Copy link
Member

@jwhonce jwhonce commented Jun 18, 2020

  • Sort images for -q option, removing duplicate id's

Fixes #6670

Signed-off-by: Jhon Honce [email protected]

@jwhonce jwhonce self-assigned this Jun 18, 2020
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jwhonce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2020
@baude
Copy link
Member

baude commented Jun 18, 2020

lgtm

@TomSweeneyRedHat
Copy link
Member

LGTM
assuming happy tests

@rhatdan
Copy link
Member

rhatdan commented Jun 18, 2020

Can you fix your commit message to something a little more descriptive. This message will be useless in the future.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need more tests to make sure all sort keys work.

cmd/podman/images/list.go Outdated Show resolved Hide resolved
@vrothberg
Copy link
Member

I noticed that --format json doesn't sort either, but already in v1.9.3:

libpod (master) $ /usr/bin/podman images --sort repository --format json
[
    {
        "ID": "1c35c441208254cb7c3844ba95a96485388cef9ccc0646d562c7fc026e04c807",
        "Names": [
            "docker.io/library/busybox:latest"
        ],
        "Created": "2 weeks ago",
        "Digest": "sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209",
        "Digests": [
            "sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209",
            "sha256:fd4a8673d0344c3a7f427fe4440d4b8dfd4fa59cfabbd9098f9eb0cb4ba905d0"
        ],
        "CreatedAt": "2020-06-02T21:19:57.279412246Z",
        "Size": 1441812,
        "ReadOnly": false,
        "History": []
    },
    {
        "ID": "a24bb4013296f61e89ba57005a7b3e52274d8edd3ae2077d04395f806b63d83e",
        "Names": [
            "docker.io/library/alpine:latest"
        ],
        "Created": "2 weeks ago",
        "Digest": "sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321",
        "Digests": [
            "sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321",
            "sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65"
        ],
        "CreatedAt": "2020-05-29T21:19:46.363518345Z",
        "Size": 5849195,
        "ReadOnly": false,
        "History": []
    }
]

I consider that a bug and would love to have that fixed as well. I'd guess that's one more motivation to sort the images at the caller in func images(...).

@jwhonce jwhonce changed the title Fixes #6670 Add support for image sort using -q option Jun 19, 2020
* Sort images for -q option, removing duplicate id's
* Sort images for --format json

Signed-off-by: Jhon Honce <[email protected]>
@jwhonce jwhonce changed the title Add support for image sort using -q option Add support for image sorting for all options Jun 19, 2020
@baude
Copy link
Member

baude commented Jun 19, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2020
@openshift-merge-robot openshift-merge-robot merged commit 89dbd1a into containers:master Jun 19, 2020
@jwhonce jwhonce deleted the issues/6670 branch June 30, 2021 16:11
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman images -q doesn't sort
7 participants