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

Support podman ps filter regular expressions like in docker CLI #3394

Closed
JeffreyVdb opened this issue Jun 21, 2019 · 2 comments · Fixed by #3599
Closed

Support podman ps filter regular expressions like in docker CLI #3394

JeffreyVdb opened this issue Jun 21, 2019 · 2 comments · Fixed by #3599
Assignees
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

@JeffreyVdb
Copy link

/kind bug

Description

To filter a container on it's exact name, the filter name=^postgres$ should work, but it doesn't. When using the filter name=postgres, containers named postgres-exporter and postgres will be returned. That's why this filter can be useful.

Steps to reproduce the issue:

Podman

  1. Run in shell: podman run --rm -d --name postgres docker://docker.io/library/postgres:11
  2. Run in shell: podman ps --filter name=^postgres$

Describe the results you received:

No output

Describe the results you expected:

CONTAINER ID  IMAGE                          COMMAND               CREATED         STATUS             PORTS  NAMES
446492b47e8a  docker.io/library/postgres:11  docker-entrypoint...  31 seconds ago  Up 31 seconds ago         postgres

Which docker outputs when podman is replaced with docker in steps to reproduce

Output of podman version:

Version:            1.4.0
RemoteAPI Version:  1
Go Version:         go1.12.5
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.5
  podman version: 1.4.0
host:
  BuildahVersion: 1.8.3
  Conmon:
    package: podman-1.4.0-2.fc30.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 0.2.0, commit: 3e5b3b1909019a42c7f5a8d47070f0808bfbb35c'
  Distribution:
    distribution: fedora
    version: "30"
  MemFree: 20706824192
  MemTotal: 33479675904
  OCIRuntime:
    package: containerd.io-1.2.6-3.3.fc30.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc8
      commit: 425e105d5a03fabd737a126ad93d62a9eeede87f
      spec: 1.0.1-dev
  SwapFree: 8589930496
  SwapTotal: 8589930496
  arch: amd64
  cpus: 8
  hostname: fedora-jeffrey
  kernel: 5.1.11-300.fc30.x86_64
  os: linux
  rootless: false
  uptime: 2h 33m 2.19s (Approximately 0.08 days)
registries:
  blocked: null
  insecure: null
  search:
  - docker.io
  - registry.fedoraproject.org
  - quay.io
  - registry.access.redhat.com
  - registry.centos.org
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 1
  GraphDriverName: overlay
  GraphOptions:
  - overlay.mountopt=nodev,metacopy=on
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  ImageStore:
    number: 13
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

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

n/a

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2019
@guits
Copy link

guits commented Jul 18, 2019

agree, this is really useful.
in the ceph-ansible project, we used to filter containers name this way too.

docker:

-bash-4.2# docker ps -a
CONTAINER ID        IMAGE                                   COMMAND             CREATED             STATUS              PORTS               NAMES
8b250a9b881d        docker.io/ceph/daemon:latest-nautilus   "sleep 10000"       17 minutes ago      Up 17 minutes                           ceph-osd-33
ba755fd63831        docker.io/ceph/daemon:latest-nautilus   "sleep 10000"       17 minutes ago      Up 17 minutes                           ceph-osd-3
-bash-4.2# docker ps -f "name=ceph-osd-3$"
CONTAINER ID        IMAGE                                   COMMAND             CREATED             STATUS              PORTS               NAMES
ba755fd63831        docker.io/ceph/daemon:latest-nautilus   "sleep 10000"       17 minutes ago      Up 17 minutes                           ceph-osd-3
-bash-4.2#

podman:

-bash-4.2# podman ps -a
CONTAINER ID  IMAGE                                  COMMAND               CREATED        STATUS            PORTS  NAMES
6ba3ae865bf4  docker.io/ceph/daemon:latest-nautilus  sleep 10000           2 minutes ago  Up 2 minutes ago         ceph-osd-44
5f550be7e697  docker.io/ceph/daemon:latest-nautilus  sleep 10000           2 minutes ago  Up 2 minutes ago         ceph-osd-4
-bash-4.2# podman ps -f "name=ceph-osd-4$"
-bash-4.2# 

from backward compatibility point of view, this is causing issues.

@rhatdan
Copy link
Member

rhatdan commented Jul 18, 2019

@QiWang19 PTAL and if you don't have time. @ashley-cui PTAL

@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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.

6 participants