Skip to content

Feat/container annotation filter#28641

Open
jiwahn wants to merge 1 commit into
containers:mainfrom
jiwahn:feat/container-annotation-filter
Open

Feat/container annotation filter#28641
jiwahn wants to merge 1 commit into
containers:mainfrom
jiwahn:feat/container-annotation-filter

Conversation

@jiwahn
Copy link
Copy Markdown

@jiwahn jiwahn commented May 4, 2026

Checklist

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

  • 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?

Added support for filtering containers by annotations with `podman ps --filter annotation=...` and `podman container prune --filter annotation=...`.

Related Issuse

Resolves #28562

Changes

  • cmd/podman/common/completion.go: Adds annotation= completion for podman ps --filter and splits out a container-prune-specific filter completion helper that includes annotation=.
  • cmd/podman/containers/prune.go: Updates podman container prune --filter to use the container-prune-specific completion helper.
  • docs/source/markdown/options/filter.container.md: Documents annotation and annotation! as supported container filters.
  • docs/source/markdown/podman-container-prune.1.md: Documents annotation-based filters for podman container prune.
  • docs/source/markdown/podman-ps.1.md.in: Adds an annotation filter example for podman ps and notes that annotation filters are not supported for external containers.
  • pkg/domain/filters/containers.go: Implements annotation and annotation! filtering for container list/prune operations and rejects them for external containers.
  • test/e2e/prune_test.go: Adds an e2e test for pruning containers by annotation.
  • test/e2e/ps_test.go: Adds e2e coverage for annotation / annotation! filters in podman ps and verifies rejection for external containers.

Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

Thanks, I have some comments. First, please also update the Swagger documentation. Then I would like to see some tests that will test negated annotations, and the last thing is, please squash commits.

Comment thread test/e2e/ps_test.go Outdated
Comment thread test/e2e/ps_test.go Outdated
Comment thread test/e2e/prune_test.go Outdated
Comment thread cmd/podman/containers/prune.go
Comment thread cmd/podman/common/completion.go
Comment thread cmd/podman/common/completion.go Outdated
Comment thread docs/source/markdown/podman-container-prune.1.md
@github-actions github-actions Bot added the kind/api-change Change to remote API; merits scrutiny label May 11, 2026
@jiwahn jiwahn force-pushed the feat/container-annotation-filter branch from 39c934d to 5e890eb Compare May 11, 2026 07:34
@jiwahn jiwahn requested review from Honny1 and TomSweeneyRedHat May 11, 2026 07:46
@packit-as-a-service
Copy link
Copy Markdown

Cockpit tests failed for commit 5e890eb. @martinpitt, @jelly, @mvollmer please check.

Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
@jiwahn jiwahn force-pushed the feat/container-annotation-filter branch from 5e890eb to ec583fa Compare May 11, 2026 11:28
Copy link
Copy Markdown
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

kind/api-change Change to remote API; merits scrutiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include annotations in filters

3 participants