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

podman ps --filter ancestor= should support regular expression to match image name #16180

Closed
xiaoyar opened this issue Oct 14, 2022 · 3 comments · Fixed by #16191
Closed

podman ps --filter ancestor= should support regular expression to match image name #16180

xiaoyar opened this issue Oct 14, 2022 · 3 comments · Fixed by #16191
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@xiaoyar
Copy link

xiaoyar commented Oct 14, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Usually image name is a relatively long string sometimes with tag name, exactly matching image name is somehow meaningless as a filter.
It should support regular expression to match image name.

Steps to reproduce the issue:

  1. I have the following containers running now.
# podman ps
CONTAINER ID  IMAGE                                COMMAND               CREATED         STATUS             PORTS       NAMES
a1da52e1ff45  docker.io/library/rockylinux:latest  /usr/lib/systemd/...  15 minutes ago  Up 15 minutes ago              foo
87e1a71aae4b  docker.io/library/nginx:latest       nginx -g daemon o...  5 minutes ago   Up 5 minutes ago               bar
cd6100f5af66  quay.io/centos/centos:latest         /usr/lib/systemd/...  2 minutes ago   Up 2 minutes ago               foobar
  1. e.g. I want to filter out all the containers whose image is pulled from 'docker.io/library', but neither podman ps --filter "ancestor=docker.io/library" nor podman ps --filter "ancestor=^docker.io/library.*" works as expected.
# podman ps --filter "ancestor=docker.io/library"
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
# podman ps --filter "ancestor=^docker.io/library.*"
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
  1. However, as comparison, `podman ps --filter "name=foo.*" can match container using regular expression.
# podman ps --filter "name=^foo.*"
CONTAINER ID  IMAGE                                COMMAND               CREATED         STATUS             PORTS       NAMES
a1da52e1ff45  docker.io/library/rockylinux:latest  /usr/lib/systemd/...  19 minutes ago  Up 19 minutes ago              foo
cd6100f5af66  quay.io/centos/centos:latest         /usr/lib/systemd/...  6 minutes ago   Up 6 minutes ago               foobar

Describe the results you received:
The ancestor filter of podman ps --filter cannot match image name using regular expression.

Describe the results you expected:
The ancestor filter of podman ps --filter should support regular expression to match image name.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:       Podman Engine
Version:      4.3.0-dev
API Version:  4.3.0-dev
Go Version:   go1.17.12
Git Commit:   03211654747f921810745993d9e3b25d29b65833
Built:        Fri Oct 14 04:43:34 2022
OS/Arch:      linux/amd64

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

It's built from the latest code pulled from GitHub

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 14, 2022
@odra
Copy link
Contributor

odra commented Oct 14, 2022

I am looking for a newcomer issue to work on, could I take this one?

@mheon
Copy link
Member

mheon commented Oct 14, 2022

Sure, feel free

@odra
Copy link
Contributor

odra commented Oct 14, 2022

Cool, thanks :-)

@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 12, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. 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 a pull request may close this issue.

3 participants