Skip to content

podman ps: allow sorting by pod (finishes #13033's --sort half) - #29637

Open
ROKUMATE wants to merge 2 commits into
podman-container-tools:mainfrom
ROKUMATE:remove-dead-ps-pod-sort
Open

podman ps: allow sorting by pod (finishes #13033's --sort half)#29637
ROKUMATE wants to merge 2 commits into
podman-container-tools:mainfrom
ROKUMATE:remove-dead-ps-pod-sort

Conversation

@ROKUMATE

@ROKUMATE ROKUMATE commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

SortPsOutput already had a case "pod" backed by the psSortedPod sorter, but pod
was not among the --sort flag's accepted values (validate.Value), so it was rejected
before ever reaching the sorter — the sort option was unreachable. This wires it up by
adding pod to the four surfaces that excluded it: the --sort accepted values, shell
completion, the invalid-option error message, and the man page. Completes the --sort
part of the RFE in #13033 (the --format part already works).

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • I have read and understood our contributing guidelines and will not have more than two open PRs as a new contributor.
  • PR description, commit message, and GitHub comments are human-written, per LLM Policy
  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?


@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you check if this is leftover or unfinished #13033 ?

@Honny1 Honny1 added the No New Tests Allow PR to proceed without adding regression tests label Aug 25, 2026
@ROKUMATE

Copy link
Copy Markdown
Contributor Author

@Honny1 yeahh checked it ... was now thinking to implement the left part of it ...
will add "pod" to the 4 surfaces that currently exclude it (validate.Value, completion, the error message, the man page)

also will change the pr description from removing to adding a complete feature of --sort=pod from the issue you mentioned

@ROKUMATE
ROKUMATE force-pushed the remove-dead-ps-pod-sort branch from 746eb78 to 64a89a2 Compare August 26, 2026 06:09
@ROKUMATE ROKUMATE changed the title pkg/domain/entities: remove unreachable "pod" ps sort option podman ps: allow sorting by pod (finishes #13033's --sort half) Aug 26, 2026
@ROKUMATE

Copy link
Copy Markdown
Contributor Author

Updated the pr , title and description accordingly
right now once decision i made as
exposing the existing pod-ID sort; happy to switch to pod-name if preferred 👍🏼

@Honny1

Honny1 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I think it should be sorted by name. Don't forget the e2e tests.

SortPsOutput already had a "pod" case backed by the psSortedPod sorter,
but "pod" was not in the --sort flag's accepted values, so it was
rejected before ever reaching the sorter and could never be used. Add
"pod" to the accepted values, the shell completion, the invalid-option
error message, and the man page so containers can be sorted (grouped) by
their pod. Completes the --sort part of the request in podman-container-tools#13033.

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
Create two pods in reverse-alphabetical order, add a container to each,
and assert that "podman ps --sort=pod" lists them ordered by pod name.

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
@ROKUMATE
ROKUMATE force-pushed the remove-dead-ps-pod-sort branch from 64a89a2 to 9693190 Compare August 26, 2026 13:20
@ROKUMATE

Copy link
Copy Markdown
Contributor Author

@Honny1 Done 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No New Tests Allow PR to proceed without adding regression tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants