containers/podman

Allow consistent exclusion filters between 'podman container list' & 'podman image list'

Open

#21,398 建立於 2024年1月28日

在 GitHub 查看
 (7 留言) (1 反應) (1 負責人)Go (3,107 fork)batch import
ContribfestGood First Issuekind/featurevolunteers-wanted

倉庫指標

Star
 (31,686 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Feature request description

$ podman image list allows the following syntax:

image filter "intermediate": must be in the format "filter=value or filter!=value"

Here's a working example:

podman image list \
    --filter='containers!=true' \
    --no-trunc='1' \
    --quiet='1'

However, currently when using $ podman container list this syntax only works for label filter:

Error: status! is an invalid filter

Providing a consistent filtering experience would allow us to transform this:

podman container list \
    --external='1' \
    --filter='status=created' \
    --filter='status=exited' \
    --filter='status=paused' \
    --filter='status=unknown' \
    --no-trunc='1' \
    --quiet='1'

Into:

podman container list \
    --external='1' \
    --filter='status!=running' \
    --no-trunc='1' \
    --quiet='1'

Suggest potential solution

Re-use code from podman image list --filter flag in $ podman container list --filter

Have you considered any alternatives?

Specifying filters manually by hand as shown above

Additional context

N/A

貢獻者指南