Skip to content

[Bug]: podman volume prune with != as filter does not work #17051

Closed
@jschintag

Description

@jschintag

Issue Description

Using podman volume prune with a filter excluding specific volumes (e.g. label!= or name!=) fails.

Steps to reproduce the issue

Steps to reproduce the issue

  1. podman volume create --label testlabel testvolume
  2. podman volume prune --filter="label!=testlabel"

Describe the results you received

[jschinta@m8345043 ~]$ podman volume create --label testlabel testvolume
testvolume

[jschinta@m8345043 ~]$ podman volume prune --filter="label!=testlabel"
WARNING! This will remove all volumes not used by at least one container. The following volumes will be removed:
Error: "label!" is an invalid volume filter

[jschinta@m8345043 ~]$ podman volume prune --filter="name!=testvolume"
WARNING! This will remove all volumes not used by at least one container. The following volumes will be removed:
Error: "name!" is an invalid volume filter

Describe the results you expected

All volumes except testvolume would be pruned (none in this case)

podman info output

$ podman info
host:
  arch: s390x
  buildahVersion: 1.28.0
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.5-1.fc37.s390x
    path: /usr/bin/conmon
    version: 'conmon version 2.1.5, commit: '
  cpuUtilization:
    idlePercent: 99.42
    systemPercent: 0.35
    userPercent: 0.23
  cpus: 4
  distribution:
    distribution: fedora
    version: "37"
  eventLogger: journald
  hostname: m8345043
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.2.0-20230109.rc3.git7.cda2413e0b30.300.fc37.s390x
  linkmode: dynamic
  logDriver: journald
  memFree: 15179411456
  memTotal: 15684050944
  networkBackend: cni
  ociRuntime:
    name: crun
    package: crun-1.7.2-3.fc37.s390x
    path: /usr/bin/crun
    version: |-
      crun version 1.7.2
      commit: 0356bf4aff9a133d655dc13b1d9ac9424706cac4
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-8.fc37.s390x
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 30744256512
  swapTotal: 30744256512
  uptime: 0h 4m 55.00s
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/jschinta/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/jschinta/.local/share/containers/storage
  graphRootAllocated: 106820345856
  graphRootUsed: 47633633280
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 3
  runRoot: /run/user/1000/containers
  volumePath: /home/jschinta/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 1668178834
  BuiltTime: Fri Nov 11 16:00:34 2022
  GitCommit: ""
  GoVersion: go1.19.2
  Os: linux
  OsArch: linux/s390x
  Version: 4.3.1


### Podman in a container

No

### Privileged Or Rootless

Rootless

### Upstream Latest Release

Yes

### Additional environment details

Additional environment details

### Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions