containers/podman

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

オープン

#21,398 opened on 2024/01/28

 (7 件のコメント) (1 件のリアクション) (1 人の担当者)Go (3,107 件のフォーク)batch import
ContribfestGood First Issuekind/featurevolunteers-wanted

Repository metrics

Stars
 (31,686 個のスター)
PR merge metrics
 (30d に merged 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

コントリビューターガイド